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
BrianMaslowskiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.