Copy Object

G

Guest

Hello.
I have a FrontEnd database that has links to tables on a BackEnd database.
On the FE i have several actions that when triggered must save a copy of the
table in question on the BE db. both tables resides on the BE.
I was trying the DoCmd.CopyObject action, but wht this does is to create a
link to the original table within the same DB. I i change a value on the
original table it changes also on the backup table.

How can i, from a FE database, create a copy of a table on the BE database
without creating a link to it?

Thanks

Luis.
 
A

Allen Browne

1. Create a query using the linked table.

2. Change it to an Append query (Append on Query menu).
Provide the name you want for your new table
Click:
Another Database
and type in the name of the back end file.

3. Switch the query to SQL View, and copy the statement.

You can now execute the copy as:
Dim strSql As String
strSql = "SELECT INTO ...
dbEngine(0)(0).Execute strSql, dbFailOnError
 
G

Guest

Hello.
I've tried this but i get the error message "Query must at least have a
destination field"
 
A

Alex Dybenko

Hi,
you have to replace:
"SELECT INTO ...
with actual SQL statement, built the way Allen wrote
 

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