Link a db file directly to an existing db

  • Thread starter Thread starter KimTong via AccessMonster.com
  • Start date Start date
K

KimTong via AccessMonster.com

Dear all,

Can I link an Acces Db file to an existing db using macro/VB?. So, we don't
need to click File, Link and pick the files that we'd like to link. Just 1
click botton, and we can do everything. Thank you....


KF
 
Try DoCmd.TransferDatabase acLink...
However, you're still going to have to provide the where and the what somehow.
 
kingston said:
Try DoCmd.TransferDatabase acLink...
However, you're still going to have to provide the where and the what somehow.
Dear all,
[quoted text clipped - 3 lines]

Thanks Kingston.
Let's say, I 'd like to link db from C:\Info.mdb on my desktop to an exsting
file on my c:\My Documents. How's it work?
 
You'd have a form with a button in the destination mdb that would run the
TransferDatabase command. You'll have to provide the source database name (&
path) and the table name in a connection string. Link a table manually and
then look at the design properties of the link to help you determine the
connection string. You should be able to get the proper syntax for your
situation in Access Help.
Try DoCmd.TransferDatabase acLink...
However, you're still going to have to provide the where and the what somehow.
[quoted text clipped - 4 lines]
Thanks Kingston.
Let's say, I 'd like to link db from C:\Info.mdb on my desktop to an exsting
file on my c:\My Documents. How's it work?
 
kingston said:
You'd have a form with a button in the destination mdb that would run the
TransferDatabase command. You'll have to provide the source database name (&
path) and the table name in a connection string. Link a table manually and
then look at the design properties of the link to help you determine the
connection string. You should be able to get the proper syntax for your
situation in Access Help.
[quoted text clipped - 5 lines]
Let's say, I 'd like to link db from C:\Info.mdb on my desktop to an exsting
file on my c:\My Documents. How's it work?

I still don't catch your mean. This is the procject: I Have WeeklyNotes.mdb
as existing db, and I'd like to import 'CanInfo' table in Data_CAN.mdb on 'G:\
Info Data' folder.

I created command button on the existing form. On click properties, I put
script:
DoCmd.Transferdatabase aclink, .......
I don't know what to write after that. Could you finish that script?. I am
really appreciated.
 
Back
Top