JavaScript Editor js editor     Web development 

Main Page

Occurs before a table or view contained in the database is opened. There are two versions of the syntax.

PROCEDURE dbc_BeforeOpenTable(cTableName) 
PROCEDURE dbc_BeforeOpenTable



Specifies the name of the table or view being opened.


You can use method code in the dbc_BeforeOpenTable event to track attempted access before a table is opened in the database. This event occurs anytime a table or view in the database is opened either explicitly by the USE command or implicitly by other commands such as SELECT.

If the underlying tables are not open when a view is opened, this event occurs for both the tables and the view. The dbc_BeforeOpenTable event receives the name of the table as the parameter and not the cursor name.

Return .F. from this procedure to prevent the table from being opened.


В Copy Code
* Reports the method name, where it is called from and the 
* value of the paramater cTableName.
PROCEDURE dbc_BeforeOpenTable ;
? '>>   ' + PROGRAM()
?? ' in ' + SUBSTR(SYS(16),RAT('\',SYS(16))+1)
? '     cTableName = ' + TRANSFORM(cTableName) + ' - ' ;
                    + TYPE('cTableName')+' /end/ '

See Also

JavaScript Editor js editor     Web development