Solved

ASP ODBC connection to AS400

Posted on 2003-11-20
7
8,502 Views
Last Modified: 2008-04-16
I am having a problem with my asp page not connecting to the AS/400.  When I go to that page I.E. seems to try to connecto, but eventually does nothing.  My timeout is set to 30 seconds but it doesn't even do that.

Here is the connection code that I took from this website

<%
dim mConn
dim mRS

set mConn = server.createobject("ADODB.Connection")
mConn.Open "DSN=VACTOR400;UID=myuid;PWD=mypwd"

set mRS = server.createobject("ADODB.Recordset")
set mRS.ActiveConnection = mConn
mRS.Open "select * file"  'does this need to be library.file ??

'do while not mRS.eof
     ' enter code for building your html table
 '    mRS.movenext
'loop

mRS.close
set mRS =nothing

mConn.close
set mConn = nothing

%>
0
Comment
Question by:digdug89
7 Comments
 

Author Comment

by:digdug89
Comment Utility
I seemed to solve the problem by using a different connection string.  This still does not resolve my problem why the above code sits in an "time out" state.  I have attached my change so anyone may view.  I will still give the points to anyone who can explain the difference and give me a correct connection string.

With mConn
.Provider = "IBMDA400"
.Properties("Data Source") = "191.6.0.1"
.Properties("User Id") = "meuid"
.Properties("Password") = "mepwd"
.Open
End With
0
 
LVL 6

Expert Comment

by:dedy_djajapermana
Comment Utility
hi...

mConn.Open "DSN=VACTOR400;UID=myuid;PWD=mypwd"
-> did you create the DSN named VACTOR400 ?

the difference i can see is on code#1, you should pre-create the DSN
on code#2 the datasource is created on the fly
0
 

Author Comment

by:digdug89
Comment Utility
Yes, I did pre-create the dsn vactor400.  That does seem to be the problem area.  However, I would like to be able to use DSN's in the future.  Sorry, if I am so "rough" at the coding, I am really an RPG400 programmer. Anyway, when I create the DSN on the fly it seems to work just peachy.  However, when I use the DSN, it seems like it is in an endless loop. I have used this code both on my test pc, and on the webserver(win2k & IIS 5.0), and both have the same problem when accessing the page with the DSN (like it's in a never-ending connecting state).  Also, anyone know where there is any type of training or books for ASP ------> AS/400. I am using Interdev and frontpage but most books out there don't deal with an AS/400 connection. Thanks for your response dedy.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 13

Expert Comment

by:samic400
Comment Utility
One problem could possibly be the way you have configured your DSN for the security if you are using Client Access as the driver.

Not sure of the specifics but under the Connection Option under the first tab, you will see some choices for Sign On Information.

If this isn't configured correctly, it is probably trying to pop up a log on box and it cannot. This could casue your time out error.
0
 

Author Comment

by:digdug89
Comment Utility
I notice under my connection options for the system dsn  I have --use operations Navigator default-- and --use same security as operations navigator connection-- for signon and security information respectively.
0
 
LVL 6

Accepted Solution

by:
dedy_djajapermana earned 500 total points
Comment Utility
in that case, connection will only be successful if you already activate client access connection to the as/400 manually.
try not to use operation navigator connection in the setup.
as for reference, you can check on:
http://www-1.ibm.com/servers/eserver/iseries/access/3tier/

cheers,

dd
0
 

Expert Comment

by:beauzero
Comment Utility
One of the things to check as well is the default library that the username you are using connects to.  You may have to "strongly type" the actual file you are looking for such as:

"Select * from aplus2.WBSIOQ Where W6WUID='somevalue'"  where aplus2 is the base library.  The user account that I log in as sets the default library to something else.

The default library setting in the ODBC CAExpress doesn't seem to work right at least in 5.1.  Good luck.  I am using .NET 1.0 not ASP so there are a few differences but none that should apply here because the .NET ODBC Connector performs basically the same in 1.0 ...can't say for 1.1
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now