Re: DSN-less connection for Informix database




i have not had this issue of versions...however, you could parse the
registry to get this information ... look at

HKEY_LOCAL_MACHINE
SOFTWARE
ODBC
ODBCINST.INI

for each installed ODBC driver you have a key / value combination ...

DriverODBCVer X.XX.XX

You could build (hardcode) a parameter string for each version type ...

Select Case <DriverODBCVer>
Case "3.500.01020.00"
lParameter = "..."
Case "3.501.010203.00"
lParameter = "Version Specific"
Case Else
lParameter = "Default Most Common"
End If

OR you could read the parameter string from a custom settings file ... this
way you can include / accomodate different driver versions without
re-deploying your application.

Create an XML file ...
myODBCConnection.xml ...

<ODBCConnections>
<ConnectionString>
<version>DEFAULT</version>
<parameterstring>...</parameterstring>
<\ConnectionString>
<ConnectionString>
<version>3.5</version>
<parameterstring>...</parameterstring>
<\ConnectionString>
<ConnectionString>
<version>3.6</version>
<parameterstring>...</parameterstring>
<\ConnectionString>
<ConnectionString>
<version>3.7</version>
<parameterstring>...</parameterstring>
<\ConnectionString>
...
<\ODBCConnections>

This way, you can have your application run w/o worries about new driver
versions ... new informix driver, update your XMLfile, send the xml file to
your users. Just make sure the version is the same as the version in the
registry... done.

Jeff

"Bill Nguyen" <billn_nospam_please@xxxxxxxx> wrote in message
news:eLm986shHHA.1624@xxxxxxxxxxxxxxxxxxxxxxx
Thanks Jeff;

The trick seemed to work for me. Only that I need to make sure all clients
have the same driver version installed.
Is there a way to find out the ODBC driver version on the client
programmatically?

Bill

"jeff" <jhersey at allnorth dottt com> wrote in message
news:%23DLMWfmhHHA.1220@xxxxxxxxxxxxxxxxxxxxxxx

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

"Bill Nguyen" <billn_nospam@xxxxxxxx> wrote in message
news:%236oCX4hhHHA.2332@xxxxxxxxxxxxxxxxxxxxxxx
Jeff;

Where do you go to get this info in the registry?
Are you talking about ODBC for Informix database?

Thanks

Bill

"jeff" <jhersey at allnorth dottt com> wrote in message
news:OkT5vkahHHA.4296@xxxxxxxxxxxxxxxxxxxxxxx
To create dsn'less ODBC connections, I create a DSN on my machine and
look at the registry to see what data elements it creates, I then
simply create a connection string. FOr example, here is on I use to
connect Timberline Software - P/O system.

Driver={Pervasive ODBC Client Interface}; ServerDSN=purchasingdata;
ServerName=10.10.10.7.1583; TCPPort=1583; TransportHint=TCP:SPX

I then add all the other connection data to it - user name, password
and so on. This string above replaces the need for me to create a DSN
connection profile on each client machine or on the citrix server.

Jeff.




"Bill Nguyen" <billn_nospam_please@xxxxxxxx> wrote in message
news:eT0MI24gHHA.1240@xxxxxxxxxxxxxxxxxxxxxxx
I have this connection string using ODBC DSN
Dim FactorJaco As String =
"dsn=jaco;catalog=factor;uid=user;pwd=passord"

This requires an ODBC DSN (jaco) at every client PC. I need to use
DSN-less connection for terminal server setup.

Any help is greatly appreciated.



Bill













.



Relevant Pages

  • Re: DSN-less connection for Informix database
    ... build an odbc for using the specificed driver ... ... Pervasive ODBC client Interface ... ... having to SETUP an odbc connection profile .. ... in your connection string, replace the DNS=jaco ... ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ADODB.Connection object not returning correct ConnectonString prop
    ... Opens the connection (successfully) ... I'm not positive but a guess is that ADO is using the MSDASQL Provider to ... provide OLE DB support for ODBC. ... ODBC Driver. ...
    (microsoft.public.data.ado)
  • Re: DSN-less connection for Informix database
    ... Is there a way to find out the ODBC driver version on the client ... on is having to SETUP an odbc connection profile .. ... in your connection string, replace the DNS=jaco ... ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Registry free DB Connection.
    ... What i want to do is the, connect to the DB without registry. ... We ship the database connection drivers with our product. ... paramters but still it takes the Driver info from registry. ...
    (comp.databases)
  • sql script doesnt work using ADO in WinXP with AS400 CA v4r4
    ... AS400 Client Access Driver v4r4? ... I tried using ADO to connect AS400 by linking Client Access ODBC driver, ... ADO connection is OK, but none of sql script working, it always got error. ...
    (borland.public.delphi.database.ado)