At present, the management information system has shifted from the traditional client/server (c/s) mode to the browser/server (b/s) mode, especially after Microsoft introduced its new product ASP language, this change is more rapid. Management Information System is the core of the database including add, modify and query operations, ASP provided by the ADO Database interface control, so that programmers no longer need to write a complex CGI program, and as long as a few simple sentences can achieve the above operation. 1. System Environment
PII 350,ram 64m,winnt Server 4.0,
Service Pack4, IIS 4.0, SQL Server7.0.
2. System function
Through the use of IE browser, the online implementation of the "Office document" data table records add and query.
3. Function realization
(1) Data table settings
① starts the Enterprise Manager for SQL Server7.0,
Add a new subdirectory "test" in the databases directory;
② adds a new table under "Test", named "Office File", field settings: FileName, char,100, allow null, file content, char,4000, allow null.
③ adds a user to SQL Server named HXL, password 123, login mode for SQL login, and set its default login database to "test";
④ adds a new user under the "test" database, named Hxl, whose role is set to "Dbowner".
(2) ODBC Links
① in Control Panel, open the ODBC data source, select the System DSN entry, and click Add;
② Select the SQL Server data source, named "Test";
③ Select login mode for SQL Server authentication, login flag is "HXL", Password is "123";
④ The default database high to "test", then test the database link, and then connect.
(3) Program documents
In order to realize the system function, here edited 3 program files, respectively "index.html", "add.asp" and "query.asp", the specific contents are as follows:
①index.html: The system home page, including two options, one is the append record, the second is the query, the user can click one of the two, you can enter the corresponding operation process. The following are the source programs:
< HTML >
< head >
< meta http-equiv= "Content-language"
content= "ZH-CN" >
< meta http-equiv= "Content-type"
content= text/html charset=gb2312 ">
< meta name=" generator "content=" Microsoft
FrontPage 4.0 ">
< meta name=" ProgId "content=" FrontPage
. Editor.document ">
< title > Example program </title >
</body >
②add.asp: The realization of the "Office document" data table records added. The page contains a single line text box (Txtbiaoti) and a scrolling text box (Txtneirong), which is used to enter the file title and file contents, respectively. In addition, there should be two buttons on the page, OK (Cmdok) and rewrite (cmdcancel), click OK to complete the record append, and click "Rewrite" to re-enter the content. The following are the source programs:
< HTML > < head > < meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> < meta name=" generator "content=" Microsoft FrontPage 4.0 "> < meta name=" ProgId "content=" FrontPage.Editor.Document "> < title > Append a new record </title >
③query.asp: Implements queries for records in the Office files datasheet. The program only implements a query for "file name" in the Office file, and the results are listed in a form (table). The following are source programs:
< HTML > < head > < meta http-equiv= "Content-type" content= "text/html;charset=gb2312" > < meta name = "Generator" content= "Microsoft FrontPage 4.0" > < meta name= "ProgId" content= "FrontPage.Editor.Document" > ; Title > Retrieve file </title >
Summarize
With IE open index.html or publish the file to the site, carry on the corresponding operation, can realize to SQL Server database system "Office document" data table record of append and inquire, this system goal has already achieved.
The above is the ASP language to implement the operation of SQL SERVER database, hope to get more of this content of children's shoes can read related articles.