Minor note... sometimes TRACERT xxx.xxx.xxx.xxx might be a little more informative than PING, even if ICMP is blocked. It can help in isolating where connections might be going wrong.
Tom
Main Topics
Browse All TopicsIn need help establishing a connection to AS400 in an ASP page. Here's where I am so far...
<%@ LANGUAGE=VBSCRIPT %>
<%
dim conn
Set conn = Server.CreateObject("ADODB
conn.open "Provider=IBMDA400;Data Source=xxxxxx;User Id=xxxxxx;Password=xxxxxxx
response.write "Successful connection!"
%>
Obviously, the xxxxxx's are my Data Source, username, and password. I've tried using the name of the Data Source as named in AS400 as well as the IP address 192.168.4.30 associated with that connection name. Neither seemed to establish a connection to the server. What am I doing wrong?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Just to make sure we understand each other: Can you can ping the AS/400 from the ASP server? It doesn't matter if you can ping each of them from your workstation - what matters is that they can see each other.
Second, is the database host server started, as outlined above?
Third, if you can ping from the ASP server to the AS/400, and the database host server is started, then what happens when you try to establish a database connection from the ASP server to the AS/400 using the Run SQL Scripts utility as outline above?
It is possible that ICMP (ping/traceroute protocol) is open between the two machines, but the TCP port required (8471 by default, 9471 if SSL) by the Client Access Database Server is not. IF it is not, then you'll need help from your network administrator to make sure that the correct ports are open between the ASP server and your AS/400.
- Gary Patterson
Check out my EE profile: http://www.experts-exchang
No, I wouldn't be able to ping the AS400 from the ASP server. The ASP server is with a webhosting company outside my network. Now I see why I can't get the connection string to do anything, its on a different network.
The AS400 database is started and working. Keep in mind though, its within my company's VPN.
How do I get these two servers talking to each other?
Well, it depends on you network configuration, and your application requirements.
Why don't you tell us more about what you need to do, from a business perspective.
You need to be aware that improper configuration or application design can result in you exposing your AS/400 to the world over the internet, and possibly disclosing valid user IDs and passwords to any intermediate network at the same time. This is not good. If you have any doubts about how to go about creating a secure connection and a secure application, get some expert help!
This kind of connection problematic form a security perspective.
The reason is that you have an insecure, publicly exposed ASP server that can be accessed by anyone, and you want to allow it to make inbound connections to your secure AS/400 on your secure network. Because of the nature of these applications, they also often contain valid user IDs and passwords embedded in connections string, config files, or other locations where they may be discovered if the ASP system is compromised. The ASP system then can be used as a launch pad from which to either compromise the secure network or secure server (AS/400 in this case), or the interfaces between the systems can be compromised and end user input and responses monitored, false information can be injected, and illegal queries/updates/deleted attempted. Depending on the application, and the nature of the data stored on the secure system, this could be very bad.
Creating secure applictions in this environment requires some very careful planning and design.
One more minor note...
> You need to be aware that improper configuration or application design can result in you exposing your AS/400 to the world over the internet...
But, also be aware that your AS/400 is the most secureable box in the whole setup. Companies often expose Windows boxes while simultaneously fearing to expose their AS/400. Fundamental guidelines can allow your AS/400 to be exposed without much concern. Obviously, if it's not secure on the internal network, it won't be better on the internet.
A Windows server with a VPN connection is effectively an inside server. The VPN provides the opening.
Tom
Business Accounts
Answer for Membership
by: Gary_The_IT_ProPosted on 2009-10-13 at 12:56:24ID: 25563780
Your connection string looks OK.
com/infoce nter/iseri es/v5r3/ in dex.jsp?to pic=/cl/st rhostsvr.h tm or use the IBM iSeries Navigator windows program (Network-Servers-iSeries Client Access-Database) to view or start the database server.
ibm.com/re dbooks/pdf s/sg246440 .pdf
e.com/M_43 82324.html
There are some pre-requisites:
1) Is the AS/400 reachable by IP? For example, can you PING the IP address or system name from the system that is running your ASP application? While PING isn't definitive (since ICMP can be blocked by a firewall or IP filtering while TCP is unblocked), a good TCP/IP connection to the system is required. The Data Source parameter can be the IP address of the system, or any DNS or hostname that resolves properly to the AS/400 Ip address. If the AS/400 and ASP application server are not on the same subnet, check and make sure that the ASP app server and AS/400 both have properly-configured gateway addresses.
You can use the Run SQL Scripts utility that is a part of iSeries Navigator (under your system name select Databases, right-click on your RDB entry, and select Run SQL Scripts, then enter a valid SQL statement). This will verify that you can connect to you the AS/400, and that the database server is up and running.
If you don't have a good connection, you'll probably need to enlist the assistance of your network administrator to help troubleshoot the problem.
2) Is the client access database host server daemon started? See the STRHOSTSVR green-screen command, http://publib.boulder.ibm.
3) For ASP.NET code examples, see section 7.3 of the excellent IBM Redbook "Integrating DB2 Universal Database for iSeries with Microsoft ADO .NET":
http://www.redbooks.
- Gary Patterson
Check out my EE profile: http://www.experts-exchang