By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,072 Members | 1,200 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,072 IT Pros & Developers. It's quick & easy.

Problem with Appending Tables

P: 4
I'm trying to append some data from one table to another table both the table structure are same. I have an attachments field in both tables but it seems that i cannot append the attachments from one table to the other.

I get the following error when trying to just append the attachments field to the appropriate field:

"An INSERT INTO query cannot contain a multi-valued field"
I also get the following error when trying to append the attachments sub fields to the appropriate sub field;

"An INSERT INTO query that contains a multivalued field cannot contain another field"
Has anyone found a way of merging, appending or updating databases with attachments?????

Many thanks in advance for any help.


Manoj Kumar
Apr 23 '09 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 1,287
This is not going to be quite so simple. You may want to take a look at How to: Work With Attachments In DAO
Apr 23 '09 #2

P: 4
I am not able to do this... Is there any other option to do this..


Thanks
Manoj Kumar
Apr 23 '09 #3

Expert Mod 2.5K+
P: 2,545
Chip has very helpfully found an MSDN entry on how to process a set of attachments and provided the link for you. Extracting the attachments is not inherently difficult; it amounts to processing a child recordset (containing the attachments) from a parent recordset (containing the records with the attachment fields). The MSDN article provides code samples which can be copied straight into your own project.

Attaching them to the other table may be more of a challenge, but in effect it is just the reverse of extracting them. You would loop through your parent recordset, and as you do so you would add entries to the other table. When it comes to the attachments, instead of saving them (which is what the MSDN article does) you would attach them to the attachment field of the current record that has been copied into the second table.

It is unlikely that a simpler way to deal with copying such attachments is available.

-Stewart
Apr 24 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.