Using a delete query to delete attachments

hunterfan48

Registered User.
Local time
Today, 06:44
Joined
Aug 17, 2008
Messages
436
Guys,
Is there a way to quickly delete hundreds of records that has an image attached in my image field for that record. I can query to show me all the records that do have an image, but I'm not finding where I can delete all the images at once.

I've tried to do a delete query but it says it won't because it is a multi valued field???

Any suggestions??

thanks
brady
 
can somebody let me know if this is possible?? if any of you have ever done it???
 
Hi Hunterfan - Are you wanting to remove the link or the image itself?

Using SQL would seem the best way... something like:

DELETE FROM myTable WHERE myField<>'';
 
Hello,
Thanks for the response. I want to remove the image itself. Would I do this in a query then?
 
Are the images embedded within the database or linked externally? You could try with SQL - something like:

Code:
DELETE FROM yourTableName WHERE yourImageFieldName IS NOT NULL;
 
I was able to make a query with this attachment field for the images that brought up every record that had an attachment (image) in the field. That SQL makes sense, but I'm not sure where I would put that. Query? Table?? Please advise further...thank you!
 
If you are just looking to clear that field rather than deleting the record then use the Query builder on your existing query to change it to an update query.

You should already have the criteria (Is Not Null), just use the Change To (from memory) row to set that field to Null or "" (zero length string), or anything else that you want.
 
If you are just looking to clear that field rather than deleting the record then use the Query builder on your existing query to change it to an update query.

You should already have the criteria (Is Not Null), just use the Change To (from memory) row to set that field to Null or "" (zero length string), or anything else that you want.


Well, I had this figured out at one time, but now I'm confused again.

I have an attachment field that I'm trying to erase all attachments.

So, I do as you instructed, but I keep getting this error.

An UPDATE or DELETE query cannot contain a multi-valued field.

Please help.
Thanks,
Brady
 

Users who are viewing this thread

Back
Top Bottom