In the current project, you need to import some data from a table in an Access database to another access database. For this reason, you have thought of multiple methods. First, you should consider using the access chain table, however, if you want to implement the link in the program, you need to use ADOX and add a new reference. Later, I considered using a program to save the data in the datatable of the program. Of course, this method does not require any new reference, but it is also troublesome to implement. After all, the SQL statement is not easy to spell, in addition, the speed is also greatly reduced. Today, I searched the internet and found that the following method can achieve the link effect without adding ADOX reference. This is a good choice.
Access tables in another MDB from one MDB
Select *
From table name in 'd: \ test. MDB'
-- Or
Select *
From [; database = D: \ test. mdb]. Table Name
However, it should be noted that the user and password must be consistent between the two access databases, otherwise the password will be invalid.
The password is inconsistent. You can use the following method:
Select *
From [; database = D: \ test. mdb; Pwd = yourpwd;]. Table Name