From RAD Studio API Documentation
Jump to: navigation, search


constructor Create(AOwner: TObject; Handle: hDBICur; CBType: CBType;  CBBuf: Pointer; CBBufSize: Integer; CallbackEvent: TBDECallbackEvent; Chain: Boolean);


__fastcall TBDECallback(System::TObject* AOwner, Bde::hDBICur Handle, Data::Dbcommontypes::CBType CBType, void * CBBuf, int CBBufSize, TBDECallbackEvent CallbackEvent, bool Chain);


Type Visibility Source Unit Parent
constructor public
Bde.DBTables TBDECallback


Creates an instance of TBDECallback and registers the specified callback with the Borland Database Engine (BDE).

Call Create to register a callback with the BDE. Create a TBDECallback object before calling any BDE function that should use the callback to respond to events.

When the BDE encounters the type of event indicated by the CBType parameter, the function specified by the CallbackEvent parameter is called. The CallbackEvent function receives a pointer to a callback descriptor. The type of the callback descriptor varies depending on the CBType. The Delphi application must allocate the memory for the callback descriptor. A pointer to this memory is passed in as the CBBuf parameter, and its size is given by the CBBufSize parameter.

The Chain parameter indicates whether this callback function should replace any other callbacks of this CBType. When Chain is false, the CallbackEvent function replaces any callbacks registered for the CBType. When Chain is true, the CallbackEvent function is called in addition to other registered callbacks.

The Handle parameter is an optional parameter indicating the database cursor associated with the BDE function that may generate the callback. Provide a Handle to make the callback specific to function calls for that cursor.

The types of callback descriptors associated with each CBType are given in the following table. For more information, see the BDE documentation.

CBTypeUsagecallback descriptor

CBType Usage callback descriptor


Respond to information about progress during large batch operations. For example, implement a progress bar or cancel button. Return cbrABORT to cancel, cbrCONTINUE to continue.



Instruct BDE on how to proceed with situations encountered during a table restructure.

Return cbrYES, to proceed with the default handling, cbrNO to proceed without the default behavior, cbrABORT to cancel the restructure.


Instruct BDE on how to proceed with situations encountered during a batch operation. Return cbrYES, to proceed with the default handling, cbrNO to proceed without the default behavior, cbrABORT to cancel the batch operation.



Respond to notifications that a table has changed. The return value is ignored.

not used


Return cbrABORT to cancel a long running query, or cbrCONTINUE to keep going. The callback is called periodically during the execution of the query.

not used


Instruct BDE on how to respond when a file (such as a lookup table) is missing. Indicate the chosen behavior in the CBInputDesc and return cbrCONTINUE.



Enter a password for an encrypted dBASE table and return cbrCONTINUE.



Respond to notifications that fields need to be recalculated. The return value is ignored.

not used


Respond to trace information about the actions taken by the BDE. The return value is ignored.



Log in to a database server. Return cbrCONTINUE.

not used.


Respond to the notification when cached updates fail to write a modified record to the database. Return cbrABORT to cancel all cached updates, cbrSKIP or cbrCONTINUE to discard the failed update and continue posting records, cbrRETRY to try the failed commit again.


Note: The VCL uses many BDE callback functions. Calling Create with Chain set to false may disable the expected behavior of some objects.

See Also