Before you can add procedure code to Database Container (DBC) events, you need to activate them. When you do not want to execute code in DBC events, you can deactivate them.
Caution: |
---|
DBC events are not available in versions prior to Visual FoxPro 7.0. Therefore, activating DBC events makes the database incompatible with versions prior to Visual FoxPro 7.0. Attempting to access a DBC events-enabled database using a version prior to Visual FoxPro 7.0 generates an error. |
To activate DBC events
-
Open database in the Database Designer.
-
On the Database menu, click Properties.
-
In the Database Properties dialog box, click Set Events On.
-
Click OK.
For more information, see Database Properties Dialog Box.
To activate DBC events programmatically
-
Make sure the database is open as the current database.
-
Use the DBSETPROP(В ) function.
For example, the following code activates DBC events:
В | Copy Code |
---|---|
DBSETPROP(cDBCName,'Database','DBCEvents',.T.) |
For more information, see DBSETPROP( ) Function.
To deactivate DBC events
-
Open database in the Database Designer.
-
On the Database menu, click Properties.
-
In the Database Properties dialog box, clear Set Events On.
-
Click OK.
For more information, see Database Properties Dialog Box.
To deactivate DBC events programmatically
-
Use the DBSETPROP(В ) function.
For example, the following code deactivates DBC events:
В | Copy Code |
---|---|
DBSETPROP(cDBCName,'Database','DBCEvents',.F.) |