Aracılığıyla paylaş


How to: Add Code to a DBC Event

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

  1. Open database in the Database Designer.

  2. 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.

  3. In the Events list, click an event.

    Tip

    To select multiple events, press and hold the SHIFT key while you click each event.

  4. Choose one of the following:

    • To add code to the stored procedure file for the current database, click Edit Code.

    -OR-

    • 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.

      Warning

      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.

An editing window for the stored procedures or external file opens with procedure template codes for the DBC event.

See Also

Tasks

How to: Enable or Disable DBC Events

Reference

Database Container Events

Other Resources

Working with Database Container Events