update query from two databases?

C

Co

Hi All,

I'm trying to create an update query using two databases in sql code.
Now I have an access query named LIJST:
SELECT * FROM Archief IN 'C:\DBase\Archief.mdb';

and a sql query in code:
sql = "UPDATE LIJST INNER JOIN RegioTmp ON
HyperlinkPart([Tbl1].Document_Link,0) =
HyperlinkPart(RegioTmp.Document_Link,0) " & _
" SET [Tbl1].Document_Datum = [RegioTmp]![Document_Datum]," & _
" [LIJST].Regio1 = [RegioTmp]![Regio1], " & _
" [LIJST].Regio2 = [RegioTmp]![Regio2], " & _
" [LIJST].Regio3 = [RegioTmp]![Regio3]," & _ ... etc

I want to combine these two in sql:

gloc = "C:\DBase\"
gDB = "Archief.mdb"
sql = "UPDATE Archief IN '" & gloc & gDB & "' AS Tbl1 INNER JOIN
RegioTmp ON HyperlinkPart([Tbl1].Document_Link,0) =
HyperlinkPart(RegioTmp.Document_Link,0) " & _
" SET [Tbl1].Document_Datum = [RegioTmp]!
[Document_Datum]," & _
" [Tbl1].Regio1 = [RegioTmp]![Regio1], " & _
" [Tbl1].Regio2 = [RegioTmp]![Regio2], " & _
" [Tbl1].Regio3 = [RegioTmp]![Regio3]," &
_ ... etc

Anyone know how this can be done?

Regards
Marco
 

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