Occurs before DBSetProp(В ) runs. There are two versions of the syntax.
PROCEDURE dbc_BeforeDBSetProp(cName, cType, cProperty, ePropertyValue) |
PROCEDURE dbc_BeforeDBSetProp LPARAMETERS cName, cType, cProperty, ePropertyValue |
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 DBSETPROP(В ) changes the value.
- cType
- Specifies the value of the second parameter in the DBSetProp(В ) function, the object type of the item named in cName.
- cProperty
- Specifies the value of the third parameter in the DBSetProp(В ) function, the property for which DBSETPROP(В ) changes the value.
- ePropertyValue
- Specifies the value of the fourth parameter in the DBSetProp(В ) function, the value to be assigned to the property in cProperty.
For details on valid cType and cProperty values, see DBSETPROP(В ) and DBGETPROP(В ) in Help.
Remarks
You can use the dbc_BeforeDBSetProp event to track attempted access to the database before DBSETPROP(В ) runs.
Return .F. from this procedure to prevent the property value from being set. This will cause the DBSetProp() function to return .F..
Some property values can be changed using DBSetProp(В ) or using a designer. For example, you can change the Comment property for a table using DBSetProp(В ) as well as from the table designer. Because DBSetProp(В ) makes changes directly to the database itself, dbc_BeforeModifyTable or dbc_AfterModifyTable will not catch changes made by DBSETPROP(В ). To trap for changes that could be made either way, you would need to use dbc_BeforeDBSetProp, dbc_AfterDBSetProp, dbc_BeforeModifyTable, and dbc_AfterModifyTable to check for the appropriate changes.
Example
В | Copy Code |
---|---|
* Reports to the screen Event name, where it is called from and ; * the parameter passed. PROCEDURE dbc_BeforeDBSetProp ; (cName,; cType,; cProperty,; ePropertyValue) ? '>> ' + 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') ? ' ePropertyValue = ' + TRANSFORM(ePropertyValue) + ' - ' + TYPE('ePropertyValue')+' /end/ ' ENDPROC |