Unanswered: append query in two different databases
Hy I'm Antonio from Italy. I need help to create a query (SQL) in MS Access
2003 that appends data in two identical tables named "tblUsers" stored, the
first (A) on local database logon.mdb and the second in another local
database (B) stored in "E:\utenti\logon.mdb", but i need to append only the
new records of database A that doesn't exist in database B. Someone cab help
me with the exact expression and grammar to do this?
many thanks everybody !! ;-)
the two databases names is the same: logon.mdb
the two tables names are the same: tblUsers.
this is the query i wrote, but it doesn0t work: what is bad?
The query, without the clause WHERE, works fine. but with that clause makes
an error "incorrect database name" (strange). But without that clause it
still append all records and not only tha are new in he master.
INSERT INTO tblUsers ( UID, PWD, COMPARTIMENTO, UFFDOGANE, COGNOME, NOME,
INDIRIZZO, CAP, COMUNE, PROVINCIA, TELEFONO, CELLULARE, TELEFAX, EMAIL, WWW,
ID, ADMIN, ENABLED, YEARENABLEDDATE, MONTHENABLEDDATE, DAYENABLEDDATE,
COD_Questionario ) IN 'E:\Documenti Antonio\Siti Web\CoNaSpDo\FAD\FAD\
SELECT tblUsers.UID, tblUsers.PWD, tblUsers.COMPARTIMENTO, tblUsers.UFFDOGANE,
tblUsers.COGNOME, tblUsers.NOME, tblUsers.INDIRIZZO, tblUsers.CAP, tblUsers.
COMUNE, tblUsers.PROVINCIA, tblUsers.TELEFONO, tblUsers.CELLULARE, tblUsers.
TELEFAX, tblUsers.EMAIL, tblUsers.WWW, tblUsers.ID, tblUsers.ADMIN, tblUsers.
ENABLED, tblUsers.YEARENABLEDDATE, tblUsers.MONTHENABLEDDATE, tblUsers.
WHERE tblUsers.UID<>[E:\Documenti Antonio\Siti Web\CoNaSpDo\FAD\FAD\
You could dynamically attach the table from the external database, execute your query on it then detach it. Another possibility would be to open that external database (Set dbs = OpenDatabase(... etc. ). Personally I prefer the first solution.