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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT INTO from 2 different DB sources 1

Status
Not open for further replies.

phiberdelic

Technical User
Oct 26, 2002
6
US
In a nutshell I have 1 table inside Access (AccessTable), and one table inside SQL server (SQLTable). I am connected to the SQL DB via ODBC connection and I want to pull the matching data from the SQL table into my Access table, but I get a syntax error. When I create "AccessTable" on the SQL DB this statement runs fine (very slow but fine). If I connect to the SQLTable using Get Link Table, this statement works fine...however I can't edit linked tables. Please Help!!!

"INSERT INTO AccessTable SELECT Vendor, ProductID FROM SQLTable WHERE SQLTable.Vendor='03'"
 
db should be set to SQL database and replace App.Path & "\dbName.mdb" with your access db path and name.
"Insert Into Accesstable IN '" & App.Path & "\dbName.mdb" & "' Select * from SQLTable where sqltable.vendor=3" Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top