Solved

Connecting to DB2 in classic ASP application

Posted on 2013-01-17
4
1,139 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

919 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

21 Experts available now in Live!

Get 1:1 Help Now