Solved

ASP ODBC connection to AS400

Posted on 2003-11-20
7
8,511 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
ID: 9790776
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
ID: 9792485
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
ID: 9797223
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 13

Expert Comment

by:samic400
ID: 9798326
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
ID: 9799535
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
ID: 9804896
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
ID: 10402706
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
End iSeries Job Programmtically 13 445
AS400 / OS400 security guidelines & hardenings & patchings 10 104
RUNRMTCMD from AS/400 12 47
iSeries Save via Virtual Tape to Nas 2 23
SEO can be a real minefield to navigate, but there are three simple ways to up your SEO game just be re-assessing your content output.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

772 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