Run Time error 3156 ODBC Delete on a linked table TABLENAME failed

G

Guest

I am in the process of upsizing an Access database to sql server (for the
first time). I have been going through the forms to see if everything is
still working and I am stuck on this problem. I have a command button that
should delete the current record if clicked.
Here's the old code (before I upsized):
DoCmd.RunCommand acCmdDeleteRecord

Here's the new code:
strSql = "DELETE ProspectID FROM Prospect WHERE (((ProspectID)="
& Me.ProspectId & "));"
CurrentDb.Execute strSql, dbSeeChanges

Sometimes the first option works (but sometimes I get an error RunCommand
cancelled), the second option works for the first record, but if I leave the
form and then open it again and try to delete another record it runs for at
least a minute
and then gives me an error message - Run Time error 3156 ODBC Delete on a
linked table TableName failed. What's the best way to delete these records?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top