BeforeCreateView, AfterCreateView
These database events fire when a view is created.
Usage |
PROCEDURE DBC_BeforeCreateView( cViewName ) PROCEDURE DBC_AfterCreateView( cViewName, lRemote ) |
Parameter |
Value |
Meaning |
cViewName |
Character |
The name of the view being created. |
lRemote |
.T. |
The view is a remote view. |
.F. |
The view is a local view. |
We can't understand why BeforeCreateView doesn't have an lRemote parameter. Whether you create the view programmatically using CREATE SQL VIEW or visually using the View Designer, by the time BeforeCreateView fires, you've told VFP whether you're creating a remote view or a local one. |
Example |
PROCEDURE DBC_BeforeCreateView(cViewName) WAIT WINDOW PROGRAM() + CHR(13) + cViewName * Ensure that view names follow the naming convention of using * "LV_" as a prefix for local views and "RV_" for remote views. PROCEDURE DBC_AfterCreateView(cViewName, lRemote) IF (lRemote AND LEFT(cViewName, 3) <> "RV_") OR ; (NOT lRemote AND LEFT(cViewName, 3) <> "LV_") MESSAGEBOX(cViewName + " doesn't follow the corporate " + ; "naming convention for views.") ENDIF |
See Also |