Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP ODBC connection to AS400

Posted on 2003-11-20
7
Medium Priority
?
8,535 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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 1500 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Ranking ecommerce websites is a vital process. You need to have a strong SEO (Search Engine Optimization) strategy. If you don’t have one, you are losing out on brand impressions, clicks and sales. Check this guide on how to improve website traffic …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview
Suggested Courses

877 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