Link to home
Start Free TrialLog in
Avatar of BrianMaslowski
BrianMaslowski

asked on

ASP With AS400

I'm hoping to find someone with ANY experience connecting to an AS400 database using ASP.  I have written a dll that connects to the AS400 successfully when I Visual Basic.  When I use ASP, however, the program will not connect.  I get the error
"Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[IBM][Client Access ODBC Driver (32-bit)][DB2/400 SQL]Communication link failure. COMM RC=0x5

/ProviderContacts/ProviderNumberData.asp, line 3
"

I;m sure it's a simple problem in my odbc driver on the IIS Server - the asp line that it errors on is this:
cnADO.Open "DSN=*****;UID=***;PWD=***"

Thanks,
Brian
Avatar of JOK
JOK

Check out http://www.asptoday.com/articles/19990608.htm

Don't know much about AS400, but maybe that article will help.
Can you connect to the ODBC database via an Access database? Or does that VB program connect to the ODBC database on the Web Server machine? If it doesn't I suggest you look into connection problems between your web server and the AS/400.

If it does, you may be using the wrong sort of cursor for your ADO connection.

cnADO.Open "DSN=*****;UID=***;PWD=***", CursorType:=adOpenDynamic

Is that all you have on your Open statement?

cnADO.Open "DSN=*****;UID=***;PWD=***"

Or is there more to it you have not yet posted on here?
Avatar of BrianMaslowski

ASKER

Here is the ASP CODE:
<%
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open "DSN=*****;UID=****;PWD=******, CursorType=adOpenDynamic"
objConnection.CommandTimeout=0
SqlQuery = "Select Lstnam, FstNam, LiceNo, ProvNo From MHSFLP.PRVMAS Where LSTNAM = 'SMITH'"

Set rsProviders = objConnection.Execute(SqlQuery)
%>

<%Do While Not rsProviders.EOF%>
      <% = rsProviders("ProvNo")%>
      <% = rsProviders("LstNam")%>
      <% = rsProviders("FstNam")%>
      <% = rsProviders("LiceNo")%>
      <%rsProviders.MoveNext%>
<%Loop%>
Avatar of Mark Franz
What is "DSN=*****"?  I hope you are actually specifying a dsn source.

i put the *'s on the dsn, username and password.  Yes, they are different in code.

Bri
20 points are too less....
20 shouldn't be too little - it's either a question that you know or don't.  If someone has actual experience using asp and an as400 they should know this.  or I could be wrong.

Brian
ASKER CERTIFIED SOLUTION
Avatar of TheImmortal
TheImmortal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the help.  I actually got around the problem by installing the CWBCFG utility from IBM Client Access.  It did have to do with client access connecting on the user level side.

Brian