With the rapid development of Internet technology, computers are playing an increasingly important role in various industries. The use of advanced information technology and database technology to build intranet within the company, the development of web-based database management system, can greatly improve work efficiency and cost savings. ASP (Active server Page) is a Microsoft launched server-side command execution environment, not browser-independent, the script is run entirely on the server, will generate dynamic information, the formation of ordinary HTML files, sent to the client. ADO (ActiveX Data Objects) is the ASP built-in ActiveX server component, can realize "immediate updating, real-time display" the newest Web database technology in the client side, can conveniently through the browser page realizes to the data input, the inquiry, the update and so on the operation.
First, using ASP and ADO to implement the workflow of database operation
ASP embedded five objects resquest, Response, Server, seesion, application, the realization of information acquisition, transmission and preservation. The main objects of ADO are connection, Command, Recordset and so on. Using ADO's Connection object and ODBC's setting, we can establish the connection with a variety of databases (Informix, Oracle, access, etc.), so as to realize data input, query and update operation. First, using the CreateObject method of ASP's server object to create an object instance of ADO, the Connection object of ADO is used to establish the connection between the corresponding database and the application program. Then, The Command object assigns the SQL (Standard Query Language) Standard Description Statement of the data request to the properties of the Command object, and then executes the input, query, and so on of the database; The database server stores the data results of the response to the Recordset object, which can be processed, parsed, and displayed on the client browser in a server-side scripting locale.
Second, the implementation of data input, query examples
The company's branches are numerous, widely distributed, the parent organizations often have to the basic institutions of the business data collection, statistics. Previously mainly through the telephone to report data, and then manually summary, statistics, compiled into a report. With the company's internal networking, you can combine the network technology and database technology, data aggregation, statistics to achieve automation. The following will be done in conjunction with the company's reality by connecting to the Informix database:
1. Creating a Database
Create a database on the UNIX operating system for data rollup and statistics, name the database cxdb, and create the following table on this database:
Create table Test
(
BR Char (6), #单位代码
DT Date, #日期
SCO Money, #业绩
)
2. Connecting to a database
On the WINDOWS98 operating system, install the database connection driver informix-cli and run INFORMIX-CLI SetNet32 to configure and then run Ilogin Demo test configuration is correct. After confirming that the configuration is successful, you can implement various operations on the Web database. You can connect to a UNIX-side database by adding the following statement to your Web page:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service