JavaScript Editor js editor     Web development 

Main Page

Occurs when a database ceases to be active. There are two versions of the syntax.

PROCEDURE dbc_Deactivate(cDatabaseName) 
PROCEDURE dbc_Deactivate



Specifies the name of the database being deactivated.


You can have many Databases open at the same time but only one can be active at a time. Several situations can deactivate a database. To explicitly deactivate a database without activating another database, use the SET DATABASE TO command without arguments.

If several databases (with DBC Events turned on) are open, when one is deactivated the dbc_Deactivate method in that database is executed.

If you place DBC Events code in a program file, the code applies to any database that specifies that program file as its events file. In such program code, use the cDatabaseName parameter to determine which database called the event. This way, you can use one block of method code to determine the deactivated database and then apply code appropriate to that database.

Return .F. from this procedure to prevent the database from being deactivated. Because closing a database implicitly deactivates it, this will also prevent the database from being closed.


В Copy Code
PROCEDURE dbc_Deactivate ;
? '     cDatabaseName = ' + TRANSFORM(cDatabaseName) + ' - ' ;
                      + TYPE('cDatabaseName')+' /end/ '

See Also

JavaScript Editor js editor     Web development