BeforeAppendProc, AfterAppendProc, BeforeCopyProc, AfterCopyProc, BeforeModifyProc, AfterModifyProc
These database events fire when the stored procedures of a database are manipulated in some way: appended from a file, copied to a file, or modified in a code window. Usage | PROCEDURE DBC_BeforeAppendProc( cFileName, nCodePage, lOverwrite ) PROCEDURE DBC_AfterAppendProc( cFileName, nCodePage, lOverwrite ) PROCEDURE DBC_BeforeCopyProc( cFileName, nCodePage, lAdditive ) PROCEDURE DBC_AfterCopyProc( cFileName, nCodePage, lAdditive ) PROCEDURE DBC_BeforeModifyProc() PROCEDURE DBC_AfterModifyProc( lChanged ) |
Parameter | Value | Meaning |
cFileName | Character | The name of the file that procedures are appended from or copied to. |
nCodePage | Numeric | The codepage for the file. VFP will automatically convert from that codepage to the codepage for stored procedures when appending procedures or vice versa when copying procedures. |
lOverwrite | Logical | Indicates whether the OVERWRITE clause was included in the APPEND PROCEDURES command. |
lAdditive | Logical | Indicates whether the ADDITIVE clause was included in the COPY PROCEDURES command. |
lChanged | Logical | Indicates whether the stored procedures were changed. |
Example | * Prevent everyone except developers from seeing or altering the * stored procedures. Store the current stored procedures in a * "before" snapshot in case we want to restore them later. PROCEDURE DBC_BeforeAppendProc(cFileName, nCodePage, lOverwrite) LOCAL llOK llOK = IsDeveloper() IF llOK DO SaveProcs ENDIF llOK RETURN llOK PROCEDURE DBC_BeforeCopyProc(cFileName, nCodePage, lAdditive) RETURN IsDeveloper() PROCEDURE DBC_BeforeModifyProc() LOCAL llOK llOK = IsDeveloper() IF llOK DO SaveProcs ENDIF llOK RETURN llOK * Log when someone changes the stored procedures. PROCEDURE DBC_AfterAppendProc(cFileName, nCodePage, lOverwrite) DO LogDBCChange WITH IIF(lOverwrite, "Overwritten by ", ; "Appended from ") + cFileName PROCEDURE DBC_AfterModifyProc(lChanged) IF lChanged DO LogDBCChange WITH "Modified" ENDIF lChanged |
See Also | Append Procedures, BeforeDBSetProp, ModifyData, Copy Procedures, Database Events, Modify Procedure |
View Updates
Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.