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/Provider NumberData .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
"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/Provider
"
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
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?
If it does, you may be using the wrong sort of cursor for your ADO connection.
cnADO.Open "DSN=*****;UID=***;PWD=***
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?
ASKER
Here is the ASP CODE:
<%
Set objConnection = Server.CreateObject("ADODB .Connectio n")
objConnection.Open "DSN=*****;UID=****;PWD=** ****, CursorType=adOpenDynamic"
objConnection.CommandTimeo ut=0
SqlQuery = "Select Lstnam, FstNam, LiceNo, ProvNo From MHSFLP.PRVMAS Where LSTNAM = 'SMITH'"
Set rsProviders = objConnection.Execute(SqlQ uery)
%>
<%Do While Not rsProviders.EOF%>
<% = rsProviders("ProvNo")%>
<% = rsProviders("LstNam")%>
<% = rsProviders("FstNam")%>
<% = rsProviders("LiceNo")%>
<%rsProviders.MoveNext%>
<%Loop%>
<%
Set objConnection = Server.CreateObject("ADODB
objConnection.Open "DSN=*****;UID=****;PWD=**
objConnection.CommandTimeo
SqlQuery = "Select Lstnam, FstNam, LiceNo, ProvNo From MHSFLP.PRVMAS Where LSTNAM = 'SMITH'"
Set rsProviders = objConnection.Execute(SqlQ
%>
<%Do While Not rsProviders.EOF%>
<% = rsProviders("ProvNo")%>
<% = rsProviders("LstNam")%>
<% = rsProviders("FstNam")%>
<% = rsProviders("LiceNo")%>
<%rsProviders.MoveNext%>
<%Loop%>
What is "DSN=*****"? I hope you are actually specifying a dsn source.
ASKER
i put the *'s on the dsn, username and password. Yes, they are different in code.
Bri
Bri
20 points are too less....
ASKER
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
Brian
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
Brian
Don't know much about AS400, but maybe that article will help.