Welcome to MSDN Blogs Sign in | Join | Help

Database Events in Stored Procedures can have default code

Try running this code:

 

CLOSE DATABASES all

CREATE DATABASE test

MODIFY DATABASE nowait

 

Now choose Database->Properties (or Alt-Enter) to bring up the Database Properties dialog. This is where you can choose Database Events to fire. Try selecting a few and then hit the Edit Code button. Something like this will show in the Stored Procedures editor:

 

 

PROCEDURE dbc_Activate(cDatabaseName)

*When DBC is made current via SET DATABASE TO <dbname> or after OPEN DATABASE completes.

 

ENDPROC

 

 

PROCEDURE dbc_AfterAddRelation(cRelationID, cTableName, cRelatedChild, cRelatedTable, cRelatedTag)

*After relation is successfully added to the DBC.

 

ENDPROC

 

 

 

 

 

 

 

Now close the editor and discard the changes. Try hitting Shift-Click on the Edit Code button. You’ll get default behavior in the Stored Procedures:

 

 

PROCEDURE dbc_AfterAddTable(cTableName, cLongTableName)

*After table is successfully added to the DBC.

      Activate Screen

      ?Program(),cTableName, cLongTableName

 

ENDPROC

 

 

PROCEDURE dbc_AfterAppendProc(cFileName, nCodePage, lOverWrite)

*After the APPEND PROC operation completed.

      Activate Screen

      ?Program(),cFileName, nCodePage, lOverWrite

 

ENDPROC

 

 

Published Tuesday, October 25, 2005 9:06 AM by Calvin_Hsia
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Database Events in Stored Procedures can have default code

Monday, October 31, 2005 5:20 PM by Nancy Folsom
This is a great time-saver, Calvin. At the risk of being an ingrate *s* I sure wish that instead of

?Program(), [etc]

it was

Debugout Program(), [etc]

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker