Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copyng table 1

Status
Not open for further replies.

ter79

IS-IT--Management
Jul 11, 2001
106
US
I'm trying to use this code to copy data from a table existing on another database to the current database that is calling the code from:

DoCmd.RunSQL "SELECT * INTO Rating IN C:\Documents and Settings\user\Desktop\Test.mdb FROM Rating;"


But I keep getting an error message "Query input must contain at least one table or query"

Thanks in advance
 
And this ?
DoCmd.RunSQL "SELECT * INTO Rating IN 'C:\Documents and Settings\user\Desktop\Test.mdb' FROM Rating;"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That helped with the error. However, all it's doing is deleting the current table in the destination database and recreating it. It's not being over any data unless I forgetting something else or misunderstanding this statement.

Any ideas
 
disregard my last post... It was working correctly but it's doing the exact opposite of what I want.

 
And this (maketable)?
DoCmd.RunSQL "SELECT * INTO Rating FROM Rating IN 'C:\Documents and Settings\user\Desktop\Test.mdb';"
Or this (append)?
DoCmd.RunSQL "INSERT INTO Rating SELECT * FROM Rating IN 'C:\Documents and Settings\user\Desktop\Test.mdb';"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I got it working with a RWOP query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top