General discussion

Locked

Acc97 Store ODBC connection

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.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Acc97 Store ODBC connection

by michal.woznicki In reply to Acc97 Store ODBC connecti ...

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=<DSN Name.ATABASE=,<Oracle TNS>;UID=<Login name>;PWD=<Password>;"
End If

Next Tdef

End Function

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

Collapse -

Acc97 Store ODBC connection

by timfox In reply to Acc97 Store ODBC connecti ...

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.

Collapse -

Acc97 Store ODBC connection

by timfox In reply to Acc97 Store ODBC connecti ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums