• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

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
0
BrianMaslowski
Asked:
BrianMaslowski
1 Solution
 
JOKCommented:
Check out http://www.asptoday.com/articles/19990608.htm

Don't know much about AS400, but maybe that article will help.
0
 
cable4096Commented:
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?
0
 
BrianMaslowskiAuthor Commented:
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%>
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mgfranzCommented:
What is "DSN=*****"?  I hope you are actually specifying a dsn source.

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

Bri
0
 
pandurangvnCommented:
20 points are too less....
0
 
BrianMaslowskiAuthor Commented:
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
0
 
TheImmortalCommented:
I ran into this problem with Client Access as well. On the version I was using, an active connection had to be made with the AS/400 via ClientAccess in order to make a Database Connection.  The problem with this is that since the ClientAccess connection is established at the USER level in NT, it is not available at the SYSTEM level which is where ASP Datasource Names need to be located. Because at the system level, a user does not have to be logged into the machine to enable connections.

The way we got around this was using the Showcase Strategy ODBC drivers. The problem with that was we needed to install software on the AS/400 to work with the drivers.

The BEST way we got around it was switching to JAVA Servlets and using the JDBC drivers in the AS/400 Toolkit from IBM.
0
 
BrianMaslowskiAuthor Commented:
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
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now