I am trying to import 4 fields from database1 into a table in database2.
Here is the code I am using:
vSQL = "INSERT INTO CITY_TABLE SELECT [Field1],[Field2],[Field3],[Field4]
FROM [All_Officesl] IN 'C:\Locations\City.mdb' WHERE [Field1] = '" & Loc & "'"
Set Recordset = New ADODB.Recordset
Call Recordset.Open(vSQL, ConnectionString, adOpenForwardOnly,
adLockReadOnly, CommandTypeEnum.adCmdText)
Set Recordset = Nothing
City_Table is the table in database2
Loc is a variable that identifies which retail location this is getting
ConnectionString is a variable that is the same as the IN statement
('C:\Locations\City.mdb' )
I keep getting an error message that says the Output table cannot be located.
What am I doing wrong....Thanks for the help.

Signature
JT
Van T. Dinh - 10 Mar 2007 04:32 GMT
Why are you using Open Recordset for an INSERT SQL???
Shouldn't it be Connection.Execute?
Check Access / VB Help / AD on Execute method.

Signature
HTH
Van T. Dinh
MVP (Access)
>I am trying to import 4 fields from database1 into a table in database2.
> Here is the code I am using:
[quoted text clipped - 20 lines]
>
> What am I doing wrong....Thanks for the help.