![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » DBISAM Technical Support » Product Manuals » DBISAM Version 4 Manual for RAD Studio 10.2 (Delphi Win64) » Using DBISAM » Exception Handling and Errors |
begin with MyDBISAMTable do begin DatabaseName:='c:\testdata'; TableName:='customer'; Exclusive:=True; ReadOnly:=False; try Open; except on E: Exception do begin if (E is EDatabaseError) and (E is EDBISAMEngineError) then begin if (EDBISAMEngineError(E).ErrorCode=DBISAM_OSEACCES) then ShowMessage('Cannot open table '+TableName+ ', another user has the table open already') else ShowMessage('Unknown or unexpected '+ 'database engine error # '+ IntToStr(EDBISAMEngineError(E).ErrorCode)); end else ShowMessage('Unknown or unexpected '+ 'error has occurred'); end; end; end; end;
Event | Description |
OnEditError | This event is triggered when an error occurs during a call to the TDBISAMTable or TDBISAMQuery Edit method . The usual cause of an error is a record lock failure if the current session is using the pessimistic locking protocol (the default). Please see the Updating Tables and the Locking and Concurrency topics for more information on using this event and the DBISAM locking protocols. |
OnDeleteError | This event is triggered when an error occurs during a call to the TDBISAMTable or TDBISAMQuery Delete method. The usual cause of an error is a record lock failure (a record lock is always obtained before a delete regardless of the locking protocol in use for the current session). Please see the Updating Tables and Query Result Sets and the Locking and Concurrency topics for more information on using this event and the DBISAM locking protocols. |
OnPostError | This event is triggered when an error occurs during a call to the TDBISAMTable or TDBISAMQuery Post method. The usual cause of an error is a key violation for a unique index or the violation of a table constraint, however it can also be triggered by a record lock failure if the locking protocol for the current session is set to optimistic. Please see the Updating Tables and the Locking and Concurrency topics for more information on using this event and the DBISAM locking protocols. |
OnQueryError | This event is triggered when an error occurs during the preparation or execution of an SQL statement or script via the TDBISAMQuery ExecSQL or Open methods. If this event is assigned an event handler then it will get triggered and the event handler will have the option of aborting the current SQL statement or script. If this event is not assigned an event handler then this event will not be triggered and the exception will be raised. |
OnDataLost | This event is triggered when an error occurs during the alteration of a table's structure via the TDBISAMTable AlterTable or AddIndex methods, or via the execution of the ALTER TABLE or CREATE INDEX SQL statements by the TDBISAMQuery ExecSQL method. An error can be caused by key violations, field deletions, field conversion problems, table constraint failures, and any other type of problem during these operations. The OnDataLost event allows you to react to these errors by cancelling the current operation, continuing, or continuing without triggering this event anymore. |
Event | Description |
OnInsertError | This event is triggered whenever an exception occurs during the insertion of any record in any table. The event handler for this event can choose to retry, abort, or fail the insert operation that raised the exception. |
OnUpdateError | This event is triggered whenever an exception occurs during the update of any record in any table. The event handler for this event can choose to retry, abort, or fail the update operation that raised the exception. |
OnDeleteError | This event is triggered whenever an exception occurs during the deletion of any record in any table. The event handler for this event can choose to retry, abort, or fail the delete operation that raised the exception. |
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |