动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   Asp → 阅读文章

 用ado连接Informix的资料

作者:东方蜘蛛(转) 来源:Chinaasp论坛 
阅读 4804 人次 , 2001-6-4 

原文地址
http://examples.informix.com/white_papers/appeng/3rd_party/ado_iis/ado_iis_note_ibyx.html

-----------------------------------------------------------------------
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 http://www.informix.com/informix/techbriefs/cli/cli.htm 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: http://www.informix.com/informix/techbriefs/cli/cli.htm
Merant Data Direct ODBC Driver: http://www.merant.com/products/datadirect
Microsoft
ADO page: http://www.microsoft.com/data/ado/.
IIS Page: http://www.microsoft.com/IIS/.
10. History
Author: Shekhar Kale
Contributors: Jaya Khera, Masood Ahmed
Initial article completed: September 1998
Last modified: February 1999
  

 本文Tagsrealplayer  
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:老外的代码分离办法
· 下一篇:关于页面和代码分离的
· Remote Scripting进阶教程---使 Remote Scripting 在客户页中有效
· 用ASP开发一个在线考试程序(八)
· DateDiff 函数 祥解
· 转换字符串单词的第一个字母为大写
· Visual InterDev常见问题解答(二)


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077