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!

Record delete error msg.

Status
Not open for further replies.

Doteco

Programmer
Jan 9, 2005
16
AU
Hi,

I'm working on an app - VB6 front end & MySQL backend - have a routine to delete all the records in selected tables. Works fine on all tables bar one in which it deletes the first record then does a recset.movenext and in the attempt to delete the next record throws up the following error:-

"Query-based delete failed because the row to delete could not be found."

I have searched for any instances of that table being left open but can't find any and can't work out why I would be getting this error msg.

Any ideas about what to try next would be greatly appreciated or if there is an easier way to empty a table from VB then I'd like to hear about it.

Regards, Doug.
 
Got it working now - the table had a date field and some of the records I saved the date as '0000-00-00' both through code from VB or by setting that as the default in MySQL (& VB sending nothing for that field).

Turned out the error was generated whenever it tried to delete a record with '0000-00-00' in the date field.

Haven't got a clue why it doesn't like that data to delete.

Hope this helps someone. Doug.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top