Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnPostError for TQuery not being executed, Why?

Status
Not open for further replies.

randall2nd

Programmer
May 30, 2001
112
US
I am using Delphi 5 on Windows 2000.

The database(paradox) has a constraint not allowing duplicate records and requires some fields to have a value.

I have a TDBGrid and TDBMemo connected to a TDatasource that is connected to a TQuery. A TDBNavigator is used to add, update, delete, scroll through the record set.

The problem is that when adding/editing records and the user does not enter enough information or duplicate information, the default database error is to criptic for them. I am trying to catch the error in the OnPostError event for the Query, and change the message displayed to provide more user friendly informtion. However, the application never seems to go through the OnPostError event.

I have tried to put a break point in the code and run it through the debugger and have put nothing but a MessageBox() in the event. But the debugger never stops at the breakpoint and when I run the executable oustside the debugger I do not recieve my messagebox.

So, Short Story "My OnPostError event for my TQuery object is not be exectued in Delphi 5."

Could I have by chance turned the error handling off? How do I get it Back? Is there a diffrent way to catch and change the error message? Any opinions,suggestions, anthing at all?

Randall2nd
 
To prevent duplicate information like ID numbers, make this field read only.
You need to use the BeforePost event to catch and correct any anormalities in your data.

Regards

Steven van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top