Occurs if a database error takes place during processing.
PSWebDataWindowClass objects
Argument |
Description |
---|---|
sqlDBCode |
Number corresponding to a database-specific error code. (See your DBMS documentation for the meaning of the code.) |
sqlErrText |
String with a database-specific error message. |
sqlSyntax |
String with the full text of the SQL statement being sent to the DBMS when the error occurred. |
buffer |
String for the buffer containing the row involved in the database activity that caused the error. |
row |
Number of the row involved in the database activity that caused the error (the row being updated, selected, inserted, or deleted). |
Boolean. You can set the return code to affect the type of error message displayed. By default, when the DBError event occurs in a DataWindow control, it displays a system error message. You can display your own message and suppress the system message by specifying a return code of true in the DBError event. You must include a return value in the event script.
This event is the equivalent of the DBError event for the PowerBuilder DataWindow.
This example redirects users to a more user-friendly error page describing the database error. It passes error parameters to the new page:
PSArgClass args = new PSArgClass ( ); args.addArg ("arg1", sqlDBCode);
args.addArg ("arg2", buffer); args.addArg ("arg3", row); psPage.Redirect("DBErrorPage.html", args); return true;
DBError in the DataWindow Reference