You can add procedure code to a DBC event by storing it in the stored procedures file for the database or in a separate program (.prg) file. When DBC events are are activated for a database, the procedure code runs.
To add code to a DBC event
Open database in the Database Designer.
On the Database menu, click Properties.
The Database Properties dialog box opens. If you activated DBC events for the database, the Events File check box appears available.
In the Events list, click an event.
Tip: To select multiple events, press and hold the SHIFT key while you click each event.
Choose one of the following:
To add code to the stored procedure file for the current database, click Edit Code.
To add code to an external file, click the Events File check box.
If no file is specified, the Open dialog displays so you can specify a file. If a file is already been specified, click the ellipsis (...) button to display the Open dialog box.
Caution: Selecting the Events File check box changes the structure of the database and makes the database no longer compatible with versions prior to Visual FoxPro 7.0 or the Visual FoxPro ODBC Driver. Clearing the Events File check box makes the database compatible.
- To add code to the stored procedure file for the current database, click Edit Code.
An editing window for the stored procedures or external file opens with procedure template codes for the DBC event.