There are many examples of programs introducing the use of ASP to develop network databases, but most of them use ACCESS as the underlying database. Compared with ACCESS, the SQL SERVER database system is much more complex, so more work is needed in program development. Based on my experience in developing management information systems, I would like to give an example here to communicate with interested friends.
Currently, the management information system has shifted from the traditional client/server (C/S) mode to the browser/server (B/S) mode, especially after Microsoft launched its new product, ASP language, this transformation has become even more rapid. The core of the management information system is to perform operations such as adding, modifying, querying the database. The ADO database interface control provided by ASP allows programmers to no longer need to write complex CGI programs, but just use a few simple statements. The above operations can be achieved. 1. System environment
PII 350, Ram 64M, WINNT Server 4.0,
Service Pack4, IIS 4.0, SQL Server 7.0.
2. System functions
By using IE browser, add and query the "Office Documents" data table records online.
3. Functional implementation
(1) Data table settings
① Start the Enterprise Manager of SQL Server7.0,
Add a new subdirectory test to the Databases directory;
② Add a new table under test, called office file, field settings: file name, char, 100, allow empty; file content, char, 4000, allow empty.
③ Add a user to SQL Server, named hxl, password is 123, login mode is SQL login, and set its default login database to test;
④ Add a new user under the test database, named hxl, and its role is set to Dbowner.
(2) ODBC link
①In the control panel, open the ODBC data source, select the system DSN item, and click Add;
②Select the SQL Server data source and name it test;
③Select login mode to SQL Server verification, login flag is hxl, and password is 123;
④ Turn the default database to test, then test the database link and connect.
(3) Program File
In order to realize the system functions, three program files were edited here, namely index.html, add.asp and query.asp. The specific content is as follows:
① index.html: The system homepage includes two options: one is to add records and the other is to query. Users can click one of the two to enter the corresponding operation process. The following is the source program:
?