General discussion

  • Creator
    Topic
  • #2307102

    Acc97 Store ODBC connection

    Locked

    by timfox ·

    I have Oracle link tables that I can only provide data from if the ODBC connection information is entered. I want to store this connection information in my Access database code, so the users do not need it – but I can’t find the proper place to store it. The table’s ‘connect’ property is not helping me very much, so far.

    Any help is appreciated.
    Thanks.

All Comments

  • Author
    Replies
    • #3362299

      Acc97 Store ODBC connection

      by michal.woznicki ·

      In reply to Acc97 Store ODBC connection

      If you have a full installation of Access you should get the option to store the connection string when you link the tables, but this is not always available.

      Here is a simple reconnection routine for Linked Tables. It allows you to store the connection string in code and reconnect the linked tables on demand. Use a Macro to “RunCode” and browse to this function which should be stored in a Module.Function UpdConnectStr()

      Dim Tdef As TableDef

      For Each Tdef In CurrentDb.TableDefs
      If Tdef.Connect <> “” Then

      Tdef.Connect = “ODBC;DSN=;UID=;PWD=;”
      End If

      Next Tdef

      End Function

      Only the Linked Tbales are affected as only they have connection strings. Just replace the variables 😉

      • #3354050

        Acc97 Store ODBC connection

        by timfox ·

        In reply to Acc97 Store ODBC connection

        I haven’t had time to implement this one the way that I want to (by calling anytime that the connection is required to be re-initiated/re-connected).
        Thanks.

    • #3354049

      Acc97 Store ODBC connection

      by timfox ·

      In reply to Acc97 Store ODBC connection

      This question was closed by the author

Viewing 1 reply thread