Partager via


dbc_BeforeCopyProc Event

Occurs before the COPY PROCEDURE command begins.

PROCEDURE dbc_BeforeCopyProc(cFileName, nCodePage, lAdditive) 

-or-

PROCEDURE dbc_BeforeCopyProc
LPARAMETERS cFileName, nCodePage, lAdditive

Parameters

  • cFileName
    Specifies the name of a text file to which the stored procedures are to be copied.
  • nCodePage,
    Specifies the code page of the text file to which the stored procedures are to be copied. Visual FoxPro copies the contents of the text file and, as it does so, automatically converts those contents to the code page you specify.
  • lAdditive
    Specifies whether the ADDITIVE keyword was included in COPY PROCEDURE command that triggered this event.

Remarks

You can use the dbc_BeforeCopyProc event to track attempted access to the database before stored procedure are copied.

Return .F. from this procedure to prevent the stored procedures from being copied.

Example

* Reports to the screen Event name, where it is called from and ;
* the parameter passed.
PROCEDURE dbc_BeforeCopyProc ;
         (cFileName,;
          nCodePage,;
          lAdditive)
 ? '>>   ' + PROGRAM()
 ?? ' in ' + SUBSTR(SYS(16),RAT('\',SYS(16))+1)
 ? '     Current DBC:      ' + SUBSTR(DBC(),RAT('\',DBC())+1)
 ? '     cFileName       = ' + TRANSFORM(cFileName)  + ' - ' + TYPE('cFileName')
 ? '     nCodePage       = ' + TRANSFORM(nCodePage)  + ' - ' + TYPE('nCodePage')
 ? '     lAdditive = ' + TRANSFORM(lAdditive) + ' - ' + TYPE('lAdditive')+' /end/ '
ENDPROC

See Also

Enable or Disable DBC Events | dbc_AfterCopyProc Event