Database connection:
The following is the reference content:
<%
set conn = server.createObject (adodb.connection)
conn.open driver = {microSoft Access Driver (*.mdb)}; DBQ = & Server.MAPPATH (database name)
%>
Open the database:
The following is the reference content:
exec = select * from database table
set rs = server.createObject (Adodb.oldSet)
RS.Oopen Exec, Conn, 1,1
Parameter 1, 1 to read
Read the content format: <%= rs (field)%>
Add record processing program:
The following is the reference content:
<%
set conn = server.createObject (adodb.connection)
conn.open driver = {microSoft Access Driver (*.mdb)}; DBQ = & Server.MAPPATH (database name)
name = request.form (field) name, tel, message to submit the field value
tel = request.form (field)
message = request.form (field)
exec = Insert INTO Table Name (Field) Values ('+Field+') is separated by a comma with a comma
conn.execute exec uses Execute submission
conn.close
set conn = nothing
%>
Search processing program:
The following is the reference content:
<%
name = request.form (field) name, tel is the field value set by the form setting of the form
tel = request.form (field)
set conn = server.createObject (adodb.connection)
conn.open driver = {microSoft Access Driver (*.mdb)}; DBQ = & Server.MAPPATH (database name)
exec = select * from table where name = '+field+' and tel =+field
set rs = server.createObject (Adodb.oldSet)
RS.Oopen Exec, Conn, 1,1
%>
'The content of the page searched out
<%
do while not rs.eof
%> <tr>
<td> <%= rs (name)%> </td>
<td> <%= rs (tel)%> </td>
<td> <%= rs (time)%> </td>
</tr>
<%
rs.movenext
loop
%>
Delete record processing program:
The following is the reference content:
<%
set conn = server.createObject (adodb.connection)
conn.open driver = {microSoft Access Driver (*.mdb)}; DBQ = & Server.MAPPATH (database name)
exec = delete * from table name where number = & request.form (ID)
conn.execute exec
%>
Modify the record processing program:
The following is the reference content:
<%
set conn = server.createObject (adodb.connection)
conn.open driver = {microSoft Access Driver (*.mdb)}; DBQ = & Server.MAPPATH (database name)
exec = select * from table name where number = & request.form (ID)
set rs = server.createObject (Adodb.oldSet)
RS.Oopen Exec, Conn, 1,3 '1,3 is modified meaning
RS (name) = request.form (field) 'name, tel, message is the field value set by the submission of the form
rs (tel) = request.form (field)
RS (Message) = request.form (field)
rs.update
RS.Close
set rs = Nothing
conn.close
set conn = nothing
%>
Modify the record execution program: Enter the ID number page >>> Export the corresponding ID data >>>>>> Directly modified processing program
Example of login processing procedures:
The following is the reference content:
<%
dim name, password
name = request.form (name)
password = request.form (password)
dim exec, conn, rs
exec = select *from table name where (name = '& field &' and password = '& field &')
set conn = server.createObject (adodb.connection)
conn.open driver = {microSoft Access Driver (*.mdb)}; DBQ = & Server.MAPPATH (database name)
set rs = server.createObject (Adodb.oldSet)
RS.Oopen Exec, Conn
if not rs.eof then
RS.Close
conn.close
session (Checked) = yes
session (Check) = Right
response.redirect index.asp
else
session (Checked) = NO
session (Check) = w
response.redirect login.asp
end if
%>
Each background page plus:
<%if not session (checked) = yes then 'session define a checked string variable
response.redirect login.asp
else
%>