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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EBDEngine Exception - Record/Key deleted

Status
Not open for further replies.

Glosh

Programmer
Nov 19, 2001
2
GB
Using Delphi 3 under Windows NT

I have a DBgrid, dataset etc.. on a form connecting to a SQL server. Everything works fine up until data is posted from the dataset to the database, either with an explicit call to post or with an insert. AT this point I get a runtime error of

"EBDEngine Exception - Record/Key deleted"

The information is posted to the db and is available when the application is restarted, but obviously, I'd kinda prefer it not to crash out every time new data is posted.

Does anyone have any ideas on what is going on here and how I can fix it.

Thanks
 
With you working against a SQL Server database - what dataset components are you using ? TTables or TQuerys - are you editing them directly in the grids ??
What we do is to have a TQuery component that is used to show the data on the screen (i.e. a SELECT ... FROM Table query) which is closed and opened when data is inserted, deleted or updated (each of these actions working through a different TQuery component - one which does the INSERT action, another for the UPDATE and one for the DELETE) each being passed the appropriate parameters to allow the work to happen.
Your problem reads as if if it might something fundamental like you're using a TTable component and allowing direct editing through the DBGrid component. Furthermore it sounds as if you're actually editing the primary key fields such that the table records cannot update themselves as you have changed the data in these key fields.
Hope there's something to help you here...
Steve
 
HI Steve,
Thanks for the input.
Yes, I am using a TTable component and whilst direct editing via the DB grid is possible at the moment, the data is entered via data-aware controls - DBEdit etc...
Would you recommend against this method?

The primary key field is an ID column and is not included in the dataset StringFields, rather, the entry is provided by the database itself.
Thinking about it, I suspect that may be where the problkem lies, in that the component does not know the value of the key field when locating the record? Including the ID field in the dataset causes its own set of problems though with errors like "Field ID may not be NULL"

Cheers
Mark

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top