Results 1 to 2 of 2

Thread: Linking SQL7 table to Access97

  1. #1
    Silas Wild Guest

    Linking SQL7 table to Access97

    I`m trying out SQLServer7, have installed it on my workstation, have been able to open access97 and link to sql7 tables I created. Want another user to use access97 to set up her own database and link to my sql7 tables. Do I need to install anything from the sql7 beta disk on her desktop? Right now she can`t link a sql7 table to her access97 db. Thanks.

  2. #2
    Robin Guest

    Linking SQL7 table to Access97 (reply)

    Hello

    - If you have your tables Linked allready you ca have her copy your database, this is one way
    - Another way is doing the Foolwing.

    * Create a Form on her Database.
    * Add a Comand buttom And paste the code bellow.


    On Error Resume Next
    Dim e As Integer
    Dim dbremote As Database, dblocal As Database
    Dim tdf As TableDef
    Dim qdf As QueryDef
    Dim conn As String
    Set dblocal = CurrentDb

    Dim strCnn As String
    strCnn = "driver={SQL Server};server=servername;uid=sa;pwd=;database=dat abasename"
    Set dbremote = OpenDatabase("", False, False, strCnn)
    conn = dbremote.Connect

    For e = 1 To dbremote.TableDefs.Count - 1
    Set tdf = dblocal.CreateTableDef(Mid(dbremote.TableDefs(e).N ame, 5, 40))
    tdf.SourceTableName = dbremote.TableDefs(e).Name
    tdf.Connect = conn
    dblocal.TableDefs.Append tdf
    Debug.Print dbremote.TableDefs(e).Name
    Next e
    dbremote.Close


    `This peace of code Will Link all the tables in your database.

    `servername is your Computer identification.
    `Yoy May see it as (Local), but other will see it as its name.

Posting Permissions

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