Solved

Connecting to DB2 in classic ASP application

Posted on 2013-01-17
4
1,130 Views
Last Modified: 2013-01-23
Please forgive me if this is a remedial question.  I'm a java developer who has been asked to enhance a classic ASP application to interact with a DB2 database running on an AS400.  I've already asked and they don't want the app converted to .NET or Java.

To the best of my knowledge the server that this app is currently running on does not have the DB2 drivers installed on it.  I honestly don't know if I can get them to be installed.  So my main question is - is it possible to connect to DB2 from a classic ASP app if these drivers are not installed on the host server?  If it is possible how would I construct the connection string?

Any help is appreciated.  Thanks.
0
Comment
Question by:mb1969
4 Comments
 
LVL 45

Assisted Solution

by:Kdo
Kdo earned 167 total points
ID: 38788210
Hi mb,

You should be able to connect to the database from your application, but the application will need to "do all the work".  You can connect, fetch data, store/replace data, etc, but the application will need to send all of the correct SQL.  To prevent SQL injection, it's highly recommended that you implement stored procedures on the database server to do most of the work.

The first thing is to get the connection string right.

  http://connectionstrings.com/as-400

That page contains an outline of the things that you'll need to satisfy for the requirements to connect to the AW/400.  It also has a lot of examples.


Kent
0
 
LVL 8

Assisted Solution

by:mustaccio
mustaccio earned 167 total points
ID: 38788469
You will need to install the DB2 Data Server Client (or at least ODBC drivers), as the use of the Microsoft driver for DB2 is not recommended, as well as the software called DB2 Connect that acts as a gateway between ODBC requests and the protocol that AS/400 understands. The client is free, DB2 Connect you (or "they") will have to buy.

With Java, you can use the DB2 JDBC driver to connect to the database directly without the DB2 Connect gateway.
0
 

Author Comment

by:mb1969
ID: 38788681
Yeah that's what I was afraid of.  I'd really rather re-write the app in Java because then I don't care what kind of machine it runs on.  Maybe if I convince them I can't do this without having additional software installed on the current host server that will change their minds.
0
 
LVL 27

Accepted Solution

by:
tliotta earned 166 total points
ID: 38795828
I've known of others who have only used ODBC drivers provided by MS to access DB2 on AS/400s. But when problems arise, the actual IBM-supplied drivers usually resolve things.

There is no need for DB2 Connect nor any chargeable software item.

However, if there really is an issue with installing drivers, it's hard to imagine a good way to achieve assured  success. You can obtain the specs for remote database access from IBM. You should then also expect to spend a few months doing the programming necessary to communicate with a remote database server outside of drivers.

It makes practically no sense to be asked to access to some vendor's database server and then restrict installation of drivers. They're free, so there shouldn't be a problem.

BTW, you'd perhaps be better off with OLEDB or other drivers than with ODBC, but that's a separate question.

Tom
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

13 Experts available now in Live!

Get 1:1 Help Now