?
Solved

Connecting to DB2 in classic ASP application

Posted on 2013-01-17
4
Medium Priority
?
1,211 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
[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
4 Comments
 
LVL 46

Assisted Solution

by:Kent Olsen
Kent Olsen earned 501 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 501 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 498 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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 Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

752 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