Share via


dbc_BeforeRenameConnection Event

Occurs before a connection is renamed.

PROCEDURE dbc_BeforeRenameConnection(cPreviousName,cNewName)

-or-

PROCEDURE dbc_BeforeRenameConnection
LPARAMETERS cPreviousName, cNewName

Parameters

  • cPreviousName
    Specifies the current name of the connection.
  • cNewName
    Specifies the new name of the connection.

Remarks

You can use the dbc_BeforeRenameConnection event to track attempted access to the database before connections are renamed.

Return .F. from this procedure to prevent the connection from being renamed.

Example

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

See Also

Enable or Disable DBC Events | dbc_AfterRenameConnection Event