ASP connection to DB2/AS400

M

mechweb

I am trying to connect to a DB2 database on an AS400 via ASP. On the server
I can connect fine using VB, but keep getting a communcation link failure
when using the exact same code in ASP. Here is my code (I know the AS400
ODBC DSN works ok because I can connect to it from MS Access with no
problems):

set cnn = server.createobject("adodb.connection")
set rs = server.createobject("adodb.recordset")
cnn.open "DSN=SYSTEM2"

Help!
 
R

Ray at

Do you have the DSN setup on the server? Do you have drivers installed?

Ray at work
 
M

mechweb

I am using IBM's client access software and have setup a DSN which works via
VB. When I try using the DSN-less connection string below, I get provider
cannot be found.
 
M

mechweb

Yes they are, I am actually using my desktop as a dev server. When I go into
the ODBC admin I can see IBM Client Access under the drivers tab.
 
R

Ray at

Huh, how about that. Alright, with your DSN that you have setup, is that a
user DSN or system? Try creating a system DSN (and testing it) and see if
that helps.

Ray at work
 
M

mechweb

The DSN I have been using is a system DSN. In VB, I can get data back no
problem, but ASP is giving me hell. I have tried about 50 variations of a
connection string to no avail. I still think ASP should work just like in
VB, but it doesn't. Aaarrrrgggghhhhh!!!!!!!
 
R

Ray at

You're right. It should in this case. Just for the hell of it, post
relevant code and the error/line number.

Ray at work
 
M

mechweb

Here is the error, it craps out on the line that contains my cnn.open (the
code is in my first post I think):

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[IBM][Client Access ODBC Driver (32-bit)][DB2/400 SQL]Communication link
failure. COMM RC=0x3
/d1main/fieldbulletin_detail.asp, line 6
 
M

mechweb

In my VB app, I was using ADO 2.6. I changed it to reference ADO 2.0 and it
still worked ok. This has to be some kind of IIs or ASP issue, but I am not
sure I'll find the answer.

Ray at said:
Next suggestion

[re]Install the latest version of MDAC to verify that your odbcjt32.dll file
is compatible with CA.

Ray at work

mechweb said:
Here is the error, it craps out on the line that contains my cnn.open (the
code is in my first post I think):

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[IBM][Client Access ODBC Driver (32-bit)][DB2/400 SQL]Communication link
failure. COMM RC=0x3
/d1main/fieldbulletin_detail.asp, line 6

Ray at said:
You're right. It should in this case. Just for the hell of it, post
relevant code and the error/line number.

Ray at work

The DSN I have been using is a system DSN. In VB, I can get data
back
no of like
in and
see
When
 
R

Ray at

I wouldn't be so sure that it's an ASP issue. IIRC, the comm link failures
always have to do with MDAC. Either that, or the as-database daemon isn't
running... STRHOSTSVR *ALL.

Ray at work

mechweb said:
In my VB app, I was using ADO 2.6. I changed it to reference ADO 2.0 and it
still worked ok. This has to be some kind of IIs or ASP issue, but I am not
sure I'll find the answer.

Ray at said:
Next suggestion

[re]Install the latest version of MDAC to verify that your odbcjt32.dll file
is compatible with CA.

Ray at work

mechweb said:
Here is the error, it craps out on the line that contains my cnn.open (the
code is in my first post I think):

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[IBM][Client Access ODBC Driver (32-bit)][DB2/400 SQL]Communication link
failure. COMM RC=0x3
/d1main/fieldbulletin_detail.asp, line 6

You're right. It should in this case. Just for the hell of it, post
relevant code and the error/line number.

Ray at work

The DSN I have been using is a system DSN. In VB, I can get data
back
no
problem, but ASP is giving me hell. I have tried about 50
variations
of
a
connection string to no avail. I still think ASP should work just like
in
VB, but it doesn't. Aaarrrrgggghhhhh!!!!!!!

Huh, how about that. Alright, with your DSN that you have
setup,
is When I
get code
(I
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top