Solved

Connecting to DB2 in classic ASP application

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

Assisted Solution

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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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