Compartir a través de


dbc_BeforeDBGetProp Event

Occurs before the DBGetProp( ) function runs. There are two versions of the syntax.

PROCEDURE dbc_BeforeDBGetProp(cName, cType, cProperty) 

PROCEDURE dbc_BeforeDBGetProp
LPARAMETERS cName, cType, cProperty

Parameters

  • cName
    Specifies the value of the first parameter in the DBGetProp( ) function, the name of the database, field, named connection, table, or view for which DBGETPROP( ) returns information.

  • cType
    Specifies the value of the second parameter in the DBGetProp( ) function, the object type of the item named in cName.

  • cProperty
    Specifies the value of the third parameter in the DBGetProp( ) function, the property for which DBGETPROP( ) returns information.

Remarks

You can use the dbc_BeforeDBGetProp event to track attempted access to the database before DBGetProp( ) runs.

Return .F. from this procedure to prevent the property value from being returned to DBGetProp(). This will cause the DBGetProp() function to return NULL.

Example

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

See Also

Tasks

How to: Enable or Disable DBC Events

Reference

dbc_AfterDBGetProp Event

DBGETPROP( ) Function

Other Resources

Events (Visual FoxPro)