Cannot Delete From Specified Tables

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
 
M

[MVP] S.Clark

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
[email protected]
www.fmsinc.com/consulting
 
T

Ted Allen

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
 
D

Dave

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
 
Top