The article was sorted after reading the online article.
Problem:
There is a db1.mdb with a table tbl1 with two field IDs and name.
There is also a db2.mdb, with one table tbl2, and two field IDs and name in the table.
Now you want to use the name of the TBL2 in DB2 to update the name of the Tbl1 ID in DB1.
(For example, there is a list of workers, the number of workers and the names of workers, and now a group of workers, the worker's name is naturally updated.) Finance is a convenient way to update their payroll with this updated list of workers. The list of workers is DB1, and the payroll is DB2. )
The SQL statement writes this:
Strsql= "UPDATE tbl2 INNER JOIN [MS Access; pwd= password; database=db1.mdb full path].tbl1 as TMP1 on tmp1.id=tbl2.id SET tbl2.name=tmp1.name "
The extreme point can also be considered to write this:
Strsql= "UPDATE [MS Access; pwd= password; database=db2.mdb full path].tbl2 as TMP2 INNER JOIN [MS Access; pwd= password; database=db1.mdb full path].tbl1 as TMP1 on tmp1.id=tmp2.id SET tmp2.name=tmp1.name "
Obviously, [MS Access; pwd= passwords; database=db2.mdb full path].tbl2 and as Tmp1 are important.
After writing, you can use Docmd.runsql strSQL to execute.
Update, other actions can be written in accordance with.