Cannot Delete From Specified Tables

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I've got a VB.NET app that needs to delete all the records from a
single, unlinked Access table. The table has one field (non-key) of
type OLE object. When I run the query "DELETE FROM tbl_pics" I get
an error- "Could not delete from specified tables." Anyone know what
the problem is and how to fix it? Thanks in advance. ~Dave
 
Typically, the problem is that there is no key, but that's with a join in
the query.

Maybe throw an autonumber in there, key it, and see what happens.


--
Steve Clark, Access MVP
FMS, Inc.
Call us for all of your Access Development Needs!
1-888-220-6234
(e-mail address removed)
www.fmsinc.com/consulting
 
Hi Dave,

I don't currently use VB.NET, but I'll throw out a few ideas based on my
Access experience in case they may help.

It may have just been a typo, but the query sql that you posted was missing
an *. It should be "DELETE * FROM tbl_pics", and also in access you would
normally end with a semi-colon, so you may want to try that as well.

If that wasn't it, you may want to try:

"DELETE DISTINCTROW tbl_pics.* FROM tbl_pics;"

I have seen cases where DISTINCTROW was required to get delete queries to
run, usually in Access 2000 or earlier I think.

Ted Allen
 
Thanks guys, turns out is was a permissions problem. ASP didn't have
access to the file and thus couldn't delete from it. Thrown off
because it seemed to correctly get information from the file earlier.
Thanks again.

~Dave
 

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

Back
Top