Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP ODBC connection to AS400

Posted on 2003-11-20
7
Medium Priority
?
8,529 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

722 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