Re: DSN-less connection for Informix database



Jeff;

I did reply to you but the message didn't go thru for some reasons.
I got it working the way you showed me.
Thanks a million

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: Alternative to using DSN to connect to database
    ... you have to use .NET ODBC provider. ... Server is NOT optimized. ... Just because of the Admiistrator thinking DSN is easier for him to control ... > Basically my problem is that the ODBC Connection Manager in Control Panel ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Silly ODBC Connection problem
    ... it seems to me this must be done interactively on each client--either that or use the magical "DSN-less" connection. ... It's been 11 or years or so since I wrote about ODBC so it's getting kinda fuzzy. ... 556-9205 (Pacific time) ... > created a System DSN named "MyDSN" in the ODBC Administrator tool. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Alternative to using DSN to connect to database
    ... use a native driver where possible. ... Basically my problem is that the ODBC Connection Manager in Control Panel ... At present (since nearly all use the ODBC DSN Connection ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Linking to back end on a web server ?
    ... When I do the File--Get External Data and select the DSN, ... "You cannot use ODBC to import from, export to, or link an external ... Microsoft Jet or ISAM database table to your database. ... that DSN-based connection to a DSN-less connection. ...
    (microsoft.public.access.externaldata)
  • Re: Create DSN Programmatically
    ... Referring to the connection string as a Data ... > Source Name (DSN) is a naming convention used to refer to the connection ... Only in the case of ODBC API ...
    (microsoft.public.vsnet.general)