Loading ODBC DSN Server Connections

L

la knight

Hi. I'm hoping for some help as to how I can have other network users launch
and use the form application I have created to print reports without setting
up individual ODBC connections on each workstation. I read on another
question that it is possible to use the "RegisterDatabase" function of VBA
but I don't know how to deploy it.

I have the following lines of VBA code which describes my ODBC and server
connection info but I don't understand how to call upon it.

Here are the lines I have: (the xxx'x have been substituted for privacy)
__________________________________________________

Public Const sVersion As String = "xxxx.x"

'Public Const sServerIP As String = "xxxxxxx"
Public Const sServerIP As String = "xxxxxxxxxxxxxxxx"
Public Const sDSN As String = "xxxxxxxxxxxxx"

' SET Constants and variables that are site specific

Global Const cnn = "ODBC;DSN=xxxxxxx;ServerName=" & sServerIP &
";ServerDSN=" _
& sDSN &
";UID=xxxxxx;PWD=xxxxxxxx;ArrayFetchOn=1;ArrayBufferSize=8;TransportHint=TCP:SPX;DecimalSymbol=."
______________________________________________________
As you can see, I have defined the connection "Global Const cnn" but I don't
know how to call it. Should I call it when I open the Form? Or should I call
it when the Command buttons are clicked? I have command buttons on my form
which are set through macros to open/print certain reports using the ODBC
connection through queries.

Thanks so much for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top