Results 1 to 4 of 4

Thread: Link Access Databases [Resolved]

  1. #1

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141

    Link Access Databases [Resolved]

    How can I link tables from one Access dabase in another Access database through VB on the fly?
    Last edited by blindlizard; May 28th, 2003 at 02:42 PM.
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  2. #2
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    The following example utilized early binding (set references to MS Access x.x object type library) or if you have problem with this technique then use late binding instead (CreateObject function)
    VB Code:
    1. Dim AccessDB As Access.Application
    2.  
    3.     Set AccessDB = New Access.Application
    4.     With AccessDB
    5.         .OpenCurrentDatabase App.Path & "\MyDB.mdb"
    6.         .DoCmd.TransferDatabase acLink, , "\\server\drive\folder\somedb.mdb", acTable, "Table1", "LinkTable1"
    7.         .Quit
    8.     End With
    9.     Set AccessDB = Nothing
    McGenius

  3. #3

    Thread Starter
    Frenzied Member blindlizard's Avatar
    Join Date
    Feb 2001
    Location
    Austin, TX - United States of America
    Posts
    1,141
    Thanks, you da man.
    I drink to make other people more interesting!
    [vbcode]On Error GoTo Bar[/vbcode]
    http://www.monsterlizard.com

  4. #4
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    He, he, he ... Sure am ... :-))
    McGenius

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width