SQLServer: WEB-based database query

Source: Internet
Author: User
Tags web database
Welcome to the Oracle community forum and interact with 2 million technical staff. This article uses an example to describe how to use ODBIC to write an application to access the SQLSERVER database under the Chinese WIN95, we recommend the following ODBIC functions are flexible, convenient, and easy to learn. Since, many WEB-based database applications have been discussed in the database field.

Welcome to the Oracle community forum and interact with 2 million technical staff> in this article, we will use an example to describe how to use ODBIC to write an application to access the SQLSERVER database under the Chinese WIN95, we recommend the following ODBIC functions are flexible, convenient, and easy to learn. Since, many WEB-based database applications have been discussed in the database field.

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

This article uses an example to describe how to use ODBIC to write an application that accesses the SQLSERVER database under the Chinese WIN95 language. We recommend that you use the following ODBIC functions to make them flexible, convenient, and easy to learn.

In the past 97 years, WEB-based database applications have been widely discussed in the database field. WEB-based database applications combine database and WEB technologies, A service system established according to the BROWS/SERVER structure to access the database through a browser. At present, there are many products, prototype or design solutions and research papers with WEB databases as the flag. There are roughly three methods to develop database WEB applications and build WEB pages that can interact with databases: one is the Gateway Interface (CGI), the other is JDBC (JAVADATABASECONNECTIVITY), and the third is the WEB center developed by various database manufacturers.

Although their WEB-based middleware developed by database manufacturers is not universally applicable, JDBC has obvious advantages in portability, security and reliability, but it is difficult to develop and cannot meet the needs of a large number of non-professional personnel; CGI supports flexible application, rich development tools, and many common CGI programs. By traveling online, I found the WEB database CGI interface program ODBIC (Kb), small and exquisite, flexible application, and various data

Database (including FOXPRO series, SQLSERVER, ORACLE, etc.) to establish a connection.

The ODBIC (OPENDATABASEINTERNECONNECTOR) program is a shared software running on WINDOWSNT and WIN95, which can be obtained through the http://www.iodbc.com (currently ODBIC1.5, this article uses ODBIC1.4 ). ODBIC provides an interface between the browser and the database, that is, a CGI program, which can update and browse the database from time to time through the browser.

Through ODBIC, you can use standard ANSISQL statements such as SELECT, INSERT, UPDATE, and orDELETE to operate all databases set in ODBC. The biggest advantage of ODBIC is that you can use a touchpad file as the input, and the touchpad file can also receive user input parameters sent through submit in commands. the touchpad contains standard HTML commands and text, these commands and text ODBIC are directly output to the browser. Of course, the touchpad also contains ODBIC commands and variables. When ODBIC runs with a touchpad as the input, the standard HTML commands and text are directly output to the browser. If the ODBIC command is found to be executed immediately, the ODBIC variable is immediately replaced by the current value of the variable. ODBIC commands are placed in the comments line of the standard HTML language. ODBIC variables are enclosed by a pair of symbols. The following simple example shows how ODBIC commands and variables appear in the inventory file:


<! -- Database dsn = $ my_database $ --> t;
<! -- SQL select * from my_table -->;
<! -- TABLE -->;

DATABASE, SQL, and TABLE are the most basic commands of ODBIC.

This article uses an example to describe how to use ODBIC to write an application that accesses the SQLSERVER database under the Chinese WIN95 language. We recommend that you use the following ODBIC functions to make them flexible, convenient, and easy to learn. In the following example, we will use a long-distance TELEPHONE schedule of the telecom business database. The table structure is as follows (the database name is TELEPHONE and the table name is DETAIL ):

CALLER number (CALLER) called start time (START-TIME) Call duration (LENGTH) seconds call charge (FEI)

PQABCD1 0101234567 98/03 19/27 100 220

Pqabd20371123456 98/03 19/40 370 462

......

......

First, establish an ODBC database connection, open "Control Panel" in the "Settings" menu of WIN95, start the ODBC driver, and set the corresponding ODBC driver, in this example, SQLSERVER; create a data source, the data source name is also TELEPHONE. If the "control panel" does not contain an ODBC driver, you can install it from the WIN95 system disk or download it from some shared software sites. The specific method is not described here.

Then, compile the home page for long talk details query. to simplify the query, some modifier HTML statements are deleted from the list, only long talk details are retained in the query type (including phone case query and change, payment summary and details, and account handling ).

Long talk details query Home Page List: SEARCH. HTML


<HTML>
<HEAD>
<TITLE> long talk details query homepage </TITLE>
</HEAD>
<CENTER>
<TABLE>
<Font size = "5" COLOR = "#990000">
Long talk details query </FONT>
<Form method = "post" ACTION ="
../Cgi-bin/odbic.exe/cgi-bin/MODEL.html ">
<TR> <td align = "right"> <font color = "#990000">
Phone number: </FONT> </TD>
<TD> <input name = "DHHM" TYPE = "text" SIZE = "12"
>
</TD> </TR>
<TR> <td align = "right"> <font color = "#990000">
Authorization password: </FONT> </TD>
<TD> <input name = "PWD" TYPE = "password" SIZE = "12"
>
</TD> </TR>
<TR> <td align = "right"> <font color = "#990000">
Query type: </FONT> </TD>
<TD> <select name = "CATE">
<Option value => -- select --
<Option value = "ch"> long talk details
</TD> </TR>
</TABLE>
<Input type = "submit" VALUE = "query">
<Input type = "reset" VALUE = "clear"> </FONT>
</FORM>
</CENTER>
</BODY>
</HTML>

[1] [2]

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.