J
jt
Hi,
I'm Running Access 2003 using 2000 mdb format and have a database with
linked tables to 2 Access 2000 mdbs. Database A has the tables to operate
ME! Database B is only used to insert records into database A.
I'm trying to do an INSERT INTO query using linked tables from databases B
to linked tables in database A.
The query works fine when executed from the database window. And the code
works fine if the tables are local.
VBA:
Set con = New ADODB.Connection
con = CurrentProject.Connection
con.Open
con.BeginTrans
cmd = "_UPDATES01_DOCUMENTS"
con.Execute cmd, recs
_UPATES01_DOCUMENTS:
INSERT INTO DOCUMENTS ( FILE_DATE, DocNumber, Volume, Page, RecType )
SELECT DISTINCT UPDATE_DOCUMENTS.FILE_DATE, UPDATE_DOCUMENTS.DOCUMENT_NO,
UPDATE_DOCUMENTS.VOLUME, UPDATE_DOCUMENTS.PAGE, UPDATE_DOCUMENTS.REC_TYPE
FROM UPDATE_DOCUMENTS
ORDER BY UPDATE_DOCUMENTS.FILE_DATE, UPDATE_DOCUMENTS.DOCUMENT_NO,
UPDATE_DOCUMENTS.VOLUME, UPDATE_DOCUMENTS.PAGE;
s
Any ideas on this error? Or another suggestion to programmatically insert
data from Database B to Database A?
Thanks
John
I'm Running Access 2003 using 2000 mdb format and have a database with
linked tables to 2 Access 2000 mdbs. Database A has the tables to operate
ME! Database B is only used to insert records into database A.
I'm trying to do an INSERT INTO query using linked tables from databases B
to linked tables in database A.
The query works fine when executed from the database window. And the code
works fine if the tables are local.
VBA:
Set con = New ADODB.Connection
con = CurrentProject.Connection
con.Open
con.BeginTrans
cmd = "_UPDATES01_DOCUMENTS"
con.Execute cmd, recs
_UPATES01_DOCUMENTS:
INSERT INTO DOCUMENTS ( FILE_DATE, DocNumber, Volume, Page, RecType )
SELECT DISTINCT UPDATE_DOCUMENTS.FILE_DATE, UPDATE_DOCUMENTS.DOCUMENT_NO,
UPDATE_DOCUMENTS.VOLUME, UPDATE_DOCUMENTS.PAGE, UPDATE_DOCUMENTS.REC_TYPE
FROM UPDATE_DOCUMENTS
ORDER BY UPDATE_DOCUMENTS.FILE_DATE, UPDATE_DOCUMENTS.DOCUMENT_NO,
UPDATE_DOCUMENTS.VOLUME, UPDATE_DOCUMENTS.PAGE;
s
Any ideas on this error? Or another suggestion to programmatically insert
data from Database B to Database A?
Thanks
John