no, build an odbc for using the specificed driver ... my case in this
example ... Pervasive ODBC client Interface ... I know every user's machine
will have this DRIVER installed. But what I do not want to rely on is
having to SETUP an odbc connection profile .. dsn ... for each user or for
each machine.
So, what I did was created an ODBC System DSN ... opened the Regedit ...
navigate to ...
HKEY_LOCAL_MACHINE
SOFTWARE
ODBC
ODBC.INI
Find the DSN profile I just created...
Look at the KEY and VALUE list...
Dup this in the parameter string you see below..
For example, here is one that will connect to an access database ... ODBC
....
'Driver={Microsoft Access Driver
(*.mdb)};UID=admin;PWD=;DBQ=C:\Test.MDB',ConnectOption
='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT;'
I assumed you question was how to use an ODBC driver to connect to a
database without needing a User or System DSN profile. Is this correct.
If so, the above should work for you ... building your connection string.
Does this help?
If you are useing Informix ... and your DSN is jeco ...
Dim FactorJaco As String = "dsn=jaco;catalog=factor;uid=user;pwd=passord"
in your connection string, replace the DNS=jaco ... with a string you build
using the information you get from the registry entry.
the example I gave you, was for a PERVASIVE dsn'less connection string ...
instead of me using a NAMED dsn connection profile ...
DNS='myDNSProfile';uid=MyUserName;pwd=MyPassword ...
I use ...
Driver={Pervasive ODBC Client Interface}; ServerDSN=purchasingdata;
ServerName=10.10.10.7.1583; TCPPort=1583; TransportHint=TCP:SPX ;
uid=MyUserName'pwd=MyPassword
If I look at myDSNProfile in the ODBC.ini section of the registry, they will
be the following keys...
ServerDSN=purchasingData
ServerName=10.10.10.7.1583
....
all the information that is required by the Pervasive ODBC Client Interface
driver ...
....
remember, the registry only contains parameter / value lists for the
driver, nothing else. So, if you can duplicate the parameter string, you do
not need to rely on a predefined DSN. I can not give you the specific
connection string for you INFORMIX connection becuase I do not have your
driver loaded on my machine - which would allow me to create a dns profile,
and review the parameters in the registry.
Jeff