Err -2147217900 Insert into linked table

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
 
J

jt

Correction. I stated "the code works fine if the tables are local".
That is not correct. The code does not work if I import the tables.
Thanks
jt
 
J

jt

Solved: Different datatypes.
The source column UPDATE_DOCUMENTS.DOCUMENT_NO datatype is text(10).
The destination column [DocNumber] datatype was text(8)
Thanks
 

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