A Objective
This article uses the ASP technology to realize the document data management technology mainly has four aspects:
(1) All the company's documents according to the classification of the data entry database, this article is used in Access database.
(2) Using the ASP ADO component to access the database, using SQL statements to query the database.
(3) Using Web pages and IIS, the query results are displayed in the user's browser.
(4) using JavaScript to implement the Pull-down menu.
Two Concrete implementation
1. Database design
This article uses Access database, according to the company's file type, divided into 10 categories, each class divided into 10 small classes, with 10 categories to establish 10 corresponding tables. Definition of each table
As follows:
Table Name fields 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7
Company System file number filename link path file Attribution Department drafters file type effective Date
Contract File Number file name link path file Attribution Department drafters file type effective Date
Plan profile file Number file name link path file Attribution Department drafters file type effective Date
Customer profile File Number file name link path file Attribution Department drafters file type effective Date
Manage table file Number file name link path file Attribution Department drafters file type effective Date
Product profile File Number file name link path file Attribution Department drafters file type effective Date
Document file number filename link path file Attribution Department drafters file type effective Date
Audio-Video Archive file Number file name link path file Attribution Department drafters file type effective Date
Company Bulletin file number filename link path file Attribution Department drafters file type effective Date
Public Information file Number file name link path file Attribution Department drafters file type effective Date
2. In the Web page, write scripts with ASP to access the database.
2.1 Establish a data connection with the following script:
<%
Dim conn
Dim connstr
On Error Resume Next
Connstr= "dbq=" +server.mappath ("file directory. mdb") + ";D efaultdir=;D river={microsoft Access DRIVER (*.mdb)};"
Set Conn=server.createobject ("ADODB. CONNECTION ")
Conn.Open ConnStr
%>
2.2 Define the record set of the database, write the SQL statement, the script is as follows:
<%
Dim rs, SQL,
Set Rs=server.createobject ("Ado.recordset")
sql= "SELECT file number, file name, link path, file Attribution Department from table name WHERE condition"
Rs.Open conn,sql,1,1
%>
2.3 Create a Web page, insert the form, the script is as follows:
<title> title of page </title>
<body>
<form method= "POST" action= "Search.asp" >
<p> <font color= "#FF0000" > enter the string of the query </font>:<input type= "text" name= "content" size= "></" P>
<p><br>
<font color= "#FF0000" > Query file Categories:</font>
<select size= "1" name= "filetype" >
<option> Company System </option>
<option> Plan Files </option>
<option> Contract Files </option>
<option> Financial Files </option>
<option> Customer Profile </option>
<option> Certificate Files </option>
<option> Audio-Video Archive </option>
<option> Products Archive </option>
<option> Company Announcement </option>
<option> Public Information </option>
</select></p>
<p><br>
</p>
<p> <input type= "Submit" value= "Query" name= "Submit" >
<input type= "Reset" value= "all Rewrite" name= "reset" ></p>
</form>
</body>
2.4 Implement Pull-down menu with JavaScript
Use JavaScript to write menu entry code, form Menu.js, insert the following line in the Web page:
<script src= "Menu.js" language= "javascript1.2" ></script>
Since the Menu.js code is longer, it is not written here.
Three Summary
The code listed in this article has been tested, running very well in my company, of course, users can also according to their own needs, the full use of SQL statements, the database for various inquiries, updates, additions, limited to the length of this is not discussed in detail.