Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know how to dynamically link and unlink tables from SQL Server in Access, but am stuck on how to do the same thing from one Access app to another. Not sure what connection method to use, etc. for example, Link SQL Server table into access like so:

    Code:
                Dim tdf As DAO.TableDef
                Dim CONSQLSVR As String
        
                CONSQLSVR = "ODBC;Driver=SQL SERVER;SERVER=<MY SERVER>;UID=<My UserID>;PWD=" & Password & ";Database=<MY DB>;"
    
                Set tdf = CurrentDb.CreateTableDef("dbo_<SQL SERVER TABLE>")
                tdf.Connect = CONSQLSVR
                tdf.SourceTableName = "dbo.<SQL SERVER TABLE>"
                
                CurrentDb.TableDefs.Append tdf
    As you can see, i use ODBC to load a table and CreateTableDef to give it a name when loading. Not sure how to do the same thing in Access; I suppose it should be a lot simpler?

    TIA

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Hi Steve,
    Are you wanting to link to tables in another Access database, or are you wanting to link SQL Server tables to another Access database?
    Wendell

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Problem solved - issue no longer relevant. Thanks!

    I want to link to tables in another Access database - thanks!

Posting Permissions

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