用ado连接Informix的资料

网络整理 - 08-28
原文地址

-----------------------------------------------------------------------
Using ADO with IIS to connect to an Informix Database
Introduction
Informix CLI Driver
Microsoft Internet Information Server
ActiveX Data Objects
Installing Informix CLI Driver
Windows NT 4.0
Installing IIS / ADO
Windows NT 4.0
Specifications for Informix ODBC Drivers

Using Informix CLI driver with IIS/ADO

Configuration

Examples
Detailed Steps for Windows NT Samples

Conclusion
Useful Links
History
1. Introduction
IIS and ADO are part of Microsoft抯 Universal Data Access strategy. ActiveX Data Objects (ADO) enables users to write an application to access and manipulate data in a database server through an OLE DB provider. ADO's primary benefits are ease of use, high speed, low memory overhead, and compactness. ADO supports key features for building client/server and web-based applications.

Goals for this integration note were:

To understand the working of ADO and IIS.
To investigate the working Informix CLI driver with ADO with IIS.
To investigate the working Informix CLI driver with ADO with Visual Basic.
Informix CLI Driver
We used Informix CLI Driver 2.8. This driver is contained in the Informix Client SDK 2.03.

Microsoft Internet Information Server
Microsoft Internet Information Server is a Web server that enables users to publish information on a corporate intranet or on the Internet. The IIS supports HTTP, FTP and gopher services. IIS 4.0 is included in Microsoft NT Server 4.0 suite.

Click here for more information on IIS.

ActiveX Data Objects
ActiveX Data Objects (ADO) is included with Internet Information Server 4.0. ADO is an ODBC standard-compliant set of interfaces that expose the database functionality in databases through accessible objects. Many shortcuts speed up common scripting operations. ADO can be used with any language, such as Javascript, VB script, and Perl.

Because ADO works with OLE-DB providers, it can access a variety of data sources. Data sources include both traditional relational database management systems and non-database sources such as file systems, directories, spreadsheets, and full-text indexes. ADO can be easily optimized for different databases. Because ADO is used with Active Server. Pages--the dynamic content and server-side scripting environment for IIS--developers can write conditional scripts that execute different SQL commands based upon the ODBC driver being used.

Applications can be customized for different customers without having to change the code.

Click here for more information on ADO.

2.0 Installing Informix CLI Driver
Windows NT 4.0
Informix Client SDK 2.03 needs to be installed to use ADO with IIS to access Informix data. The Informix CLI Driver 2.8 comes with the Development Kit. Download Informix Client SDK 2.03.

3.0 Installing IIS/ADO
In order to install IIS/ADO, the following software is needed on your system:

ODBC 3.0
NT Server 4.0
Internet Explorer 4.0 or higher
Visual Basic 5.0 or higher
All these products can be obtained from Microsoft Corp. For details refer to the Microsoft site.

ActiveX Data Objects (ADO) is included with Internet Information Server 4.0. You may need to install ADO 2.0.

The IIS site provides additional information on administration and maintenance of IIS and its components.

4. Specifications for Informix ODBC Drivers
Informix CLI Driver
See for a techbrief on Informix CLI drivers.

Note that the current version of Informix CLI driver 2.8 only supports ODBC specifications through version 2.5.Unlike Merant drivers, Informix CLI drivers support BLOB/CLOB functionality.

Merant Data Direct ODBC Driver for Informix
Click here for information on Merant ODBC drivers for Informix.

5. Using Informix CLI driver with IIS/ADO
Typically, when the IIS services a request for data on a Web page, many data components are involved. All processing is done on the middle tier; the end user's computer simply makes the request and receives the results. Processing the request for data consists of these steps:

The Active Server Pages (ASP) makes the call to the OLE-DB data provider.
The OLE-DB data provider services the request and performs the query on the database; or, in the case of the OLE-DB data provider for ODBC data sources, a call is made to ODBC via Informix CLI driver.
The database server then processes the request for data and returns the data to the data provider.
The data provider returns the data to the requesting software. This could be either an ASP or an ISAPI DLL.
The data is then formulated in Web-page format and presented to the user.


6. Configuration
Following is the minimum configuration recommended for using this product as well as the configuration used by the testing staff.

Minimum Configuration Testing Environment
Hardware Pentium Processor
Windows NT Compatible PC
32 MB RAM
100 MB disk space Pentium Processor 5/133
HP Vectra Xm PC
40 MB RAM
2 gig disk space
Software Microsoft Windows NT Version 4.0,
Service Pack 3
Microsoft ODBC 3.0
Internet Explorer 4.0
Visual Basic 5.0 Microsoft Windows NT Version 4.0,
Service Pack 3
Microsoft ODBC 3.0
Internet Explorer 4.0
Visual Basic 6.0

7. Examples
The examples use the stores7 demonstration database. To view an example developed using VBscript click on the following link:.ADO.html.

Another example is provided in the article on using Visual Basic and ADO. IIS is not used in that example.

Detailed Steps for Windows NT Samples
The assumption before running the samples is that the user has installed all the required components by Microsoft as well as by Informix. You need to have a valid database connection to the Informix server. The Informix database server should have built the stores7 database. The database should have the customer table, with proper structure.

ADO/IIS/VBscript
Follow these steps for running the ADO/IIS/VBscript:

Edit the page ?ADO.html in your html/asp editor.
Change the variables ?dsn (Data Source name), uid (User ID), pwd (Password) and dbs (Database) to match your requirements.
Copy the file adovbs.inc to your current directory. If you have installed IIS, this file will be in the directory: NETDIRECTORY>\iissamples\sdk\asp\database.
Load the page ADO.html in Internet Explorer. (The example may not work properly using Netscape Navigator.)
Click on the button "ADO Demo".
The data will be retrieved and displayed on the web page.
ADO/VB
Follow these steps for running the ADO/VBscript:

Load the project ado.vbp in Visual Basic 5.0.
Select Project->References.
Check the selection "Microsoft ActiveX Data Objects 2.0 Library".
Run the project.
Fill in the DSN, UID, PWD and Database fields with your requirements.
Click on "Connect".
After the program connects to database, click on "Retrieve".
You can browse forward through the retrieved data, using "Next Record" button.


8. Conclusion
ADO provides access to the databases through OLE-DB and ODBC.
ADO is a standard class library which can be used on different platforms and with different application development frameworks such as Visual Basic, ASP/VBscript/IIS, Visual C++, etc.
Informix CLI Driver works with ADO. The correct data was returned with proper format.
ADO makes it easy to browse through a result set by providing standard methods.
9. Useful Links
Informix
Informix CLI driver:
Merant Data Direct ODBC Driver:
Microsoft
ADO page:
IIS Page:
10. History
Author: Shekhar Kale
Contributors: Jaya Khera, Masood Ahmed
Initial article completed: September 1998
Last modified: February 1999