connecting to another Access db

  • Thread starter Thread starter kev
  • Start date Start date
K

kev

How do I connect to another Access db from one db? I would
like to copy tables from one db to another db by pressing
a button.

Thanks

Kev
 
Hi Kev,

Go to File|Get External Data on the menu (or right click
in the whitespace of the table list in the database
window) and choose import or link tables). You can
import or link to other Access databases, Excel
Spreadsheets, text files, etc.

If you import the data, a copy of the data will be
imported into a table in your database.

If you link to the data, you will be working directly
with the data source. This may or may not be editable,
depending on the data source. Linked Access and Excel
tables are generally editable.

Choose whichever one best suits your situation.

Hope this helps.

-Ted Allen
 
Dim MyTableDef As TableDef
Dim gdb As Database

Set gdb = CurrentDb() 'Use current database

Set MyTableDef = gdb.CreateTableDef("Employees") 'Table name for target (this db)
MyTableDef.Connect = ";DATABASE=c:\Temp\Db.mdb" 'Source database
MyTableDef.SourceTableName = "Employees" 'Table name in source
gdb.TableDefs.Append MyTableDef ' Attach table.
gdb.TableDefs.Refresh 'Refresh the tables.
 
Back
Top