Pass-Trough Qry ODBC 3151 error (informix db)

vinzz

Registered User.
Local time
Today, 06:14
Joined
Apr 24, 2008
Messages
47
Hi,

I'm working with an Informix 3.32 32 BIT dbserver and want to connect my pass trough queries dsnless by setting the .connect parameter in the querydefs.

here's my odbc connection method (with pass-trough queries). I have one table in my Mdb file with the diffrent connect type's (to diffrent servers) On my form i have a dropdown box to change the odbc connection, the following is on lost_focus:
Code:
Dim db As DAO.Database
Dim item As QueryDef
Set db = CurrentDb
lodbc = "ODBC;Driver={INFORMIX 3.32 32 BIT};Host=" & Me.ListDb.Column(1) & ";Server=" & Me.ListDb.Column(2) & ";Service=onlinetcp;Protocol=olsoctcp;Database=" & Me.ListDb.Column(3) & ";Uid=test;Pwd=test;"
For Each item In db.QueryDefs
 If Left(item.Connect, 4) = "ODBC" Then item.Connect = lodbc
Next item
db.QueryDefs.Refresh
Set db = Nothing
LODBC is the string to connect to and gives this (example) checked trough debug and is correct:
Code:
ODBC;Driver={INFORMIX 3.32 32 BIT};Host=nameofhost;Server=servername;Service=onlinetcp;Protocol=olsoctcp;Database=dbprd;Uid=myid;Pwd=mypsw;
When this is done and i want to open the db, it occurs the following error (translated to english) 1351:ODBC: Could not connect to {INFORMIX 3.32 32 BIT}-rllonline. (the connection has not been made)
when i create a system-dsn it works all fine, but i don't want this!
How to get this work correct with dsn-less connections?
 
Have you tried:

ODBC;DSN='';Driver={INFORMIX 3.32 32 BIT};Host=nameofhost;Server=servername;Service=onlinetcp;Protocol=olsoctcp;Database=dbprd;Uid=myid;Pwd=mypsw;

For some reason, Informix 3.3+ requires that you specify the DSN parameter, even if the parameter value is blank. (DISCLAIMER: This is second-hand information; I have no experience with this first-hand). Try it and let us know if it works.
 
i've tried that, does'nt work, I get the same error 3151 :s
even tried dsn=;DRIVER=.... but doesn't work either.

It's just strange, when i input a ODBC system dsn to an informix server, and i delete it immediately after i created it. it will work (also if no static dsn is setted anymore!!!!?????).
It seems that it must be entered once in ODBC before dsn-less works :s
strange thing


Searching.....Answer found
used a new driver: IBM INFORMIX 3.82 32 BIT and now it works with the conn string i posted, it doesn't work if you set dsn='' or dsn= in the string in pass trough queries!

thanks for searching a solution with me!
SOLVED



edit: NOT SOLVED
it works on one pc know, but not on another, there i get the same error again and the same driver is installed :(
i don't understand anymore, i've searched a whole day, and i still have the same error.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom