Partager via


dbc_AfterCreateConnection Event

Occurs after a connection has been created.

PROCEDURE dbc_AfterCreateConnection
(cConnectionName, cDataSourceName, cUserID, cPassWord, cConnectionString) 

-Or-

PROCEDURE dbc_AfterCreateConnection
LPARAMETERS cConnectionName, cDataSourceName, cUserID, cPassWord, 
 cConnectionString

Parameters

  • cConnectionName
    Specifies the name of the connection that was created.
  • cDataSourceName
    Specifies the name of the ODBC data source.
  • cUserID
    Specifies your user identification for the ODBC data source.
  • cPassWord
    Specifies your password for the ODBC data source.
  • cConnectionString
    Specifies a connection string for the ODBC data source. You can use the connection string instead of explicitly including the ODBC data source, the user identification, and the password.

Remarks

You can use the dbc_AfterCreateConnection event to track attempted access to the database after a connection is created.

Example

* Reports to the screen Event name, where it is called from and ;
* the parameters passed.
PROCEDURE dbc_AfterCreateConnection ;
         (cConnectionName, ;
          cDataSourceName, ;
          cUserID, ;
          cPassword, ;
          cConnectionString)
? '>>   ' + PROGRAM() 
?? ' in ' + SUBSTR(SYS(16),RAT('\',SYS(16))+1)
? '     cConnectionName    = ' + TRANSFORM(cConnectionName)   + ' - ' ;
                           + TYPE('cConnectionName ')
? '     cDataSourceName    = ' + TRANSFORM(cDataSourceName)   + ' - ' ;
                           + TYPE('cDataSourceName ')
? '     cUserID            = ' + TRANSFORM(cUserID)           + ' - ' ;
                           + TYPE('cUserID ')
? '     cPassword          = ' + TRANSFORM(cPassword)         + ' - ' ;
                           + TYPE('cPassword ')
? '     cConnectionString  = ' + TRANSFORM(cConnectionString) + ' - ' ;
                           + TYPE('cConnectionString ')+' /end/ '
ENDPROC

See Also

Enable or Disable DBC Events | dbc_BeforeCreateConnection Event