DSN-less connection to an Informix Database

S

SJR@mbci

I am using the code provided at
http://www.accessmvp.com/DJSteele/DSNLessLinks.html to link to a table in an
Informix database.

It works up to this line:

dbCurrent.TableDefs.Append tdfCurrent

At this point I get the following error:
Reserved error (-7778); there is no message for this error.

I've searched google groups on this error, but can't find a good explanation
for the error. Can anyone tell me what this error may mean and how I can
fix it?

Thanks in advance for the help.
 
D

Douglas J. Steele

What Connect string are you using? (i.e.: to what did you set
tdfCurrent.Connect) Do you know that it's correct?
 
S

SJR@mbci

Thanks for the reply Doug.
Here is my connection string:

tdfCurrent.Connect = "ODBC;DRIVER={IBM INFORMIX 3.82 32 BIT};" & _
"HOST = p04s03;" & _
"SERVER = " & ServerName & ";" & _
"SERVICE = Turbo;" & _
"PROTOCOL = olsoctcp;" & _
"DATABASE = " & DatabaseName & ";" & _
"UID = informix;" & _
"PWD = informix;"

I too suspected the connection string to be the problem so I modified the
driver name to test that it is valid. I get the following error:
ODBC--call failed. (3146) encountered
so I assume that the driver name isn't the problem.

I also tried replacing the driver argument with the user DSN that I used to
create the table. I did not get any errors, but of course the table still
uses a DSN.

I think that rules out the connection string as the problem. What do you
think?
 
D

Douglas J. Steele

Sorry, I've got no experience at all with Informix, but looking at what Carl
Prothman has at
http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForInformix it
looks as though you might need to include the word DSN in your string:

tdfCurrent.Connect = "ODBC;Dsn=;DRIVER={IBM INFORMIX 3.82 32 BIT};" & _
"HOST = p04s03;" & _
"SERVER = " & ServerName & ";" & _
"SERVICE = Turbo;" & _
"PROTOCOL = olsoctcp;" & _
"DATABASE = " & DatabaseName & ";" & _
"UID = informix;" & _
"PWD = informix;"

You might also remove the spaces around the equal signs: that can sometimes
make a difference.
 
S

SJR@mbci

I removed the spaces around the equal signs and added the "Dsn=" to my
connection string. When I ran it, I got a dialog box titled "Select Data
Source" similar to the "ODBC Datasource Administrator" dialog box.

I noticed that Carl's site has connection string formats for versions 2.5
and 3.3 of the ODBC driver. I sent him an email asking if the format is
different for the version that I'm using - 3.82 . I will reply here if I
hear from him.

Thanks again for your help, Doug.
 

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