------------------------------------------------------------增加---------------------------------------------------------------------------------------------
<% comname=request.Form("name")
comsex=request.Form("sex")
comage=request.Form("age")
set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION")
'DBPath=Server.MapPath(Students.mdb)
'dbconnection.Open"driver={Microsoft Access Dirver(*.mdb)};dbp"&; DBPath
sql="select * from students"
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,conn,2,2
rs.AddNew
rs("name")=comname
rs("sex")=comsex
rs("age")=comage
rs.Update
rs.close
set rs=nothing
Response.Write ""
%>
------------------------------------------------------------删除---------------------------------------------------------------------------------------------
<%
id=request.Form("sid")
id=Sqlit(id,",")
shu=0
for i=1 to UBound(id)
sql="select from students where id="&;id(i)
Set rs=Server.CreateObject("ADODB.Recordset")
rs.execute(sql)
if not rs.EOF then
delete_file(re("id"))
end if
rs.Close
set rs=nothing
sql="delete from students where id="&;id(i)
rs.execute
sql,shu1
next
if shu>0 then
response.Write ("记录已经删除了!")
else
response.Write("数据仍然存在");
end if
%>
-----------------------------------------------------------单条查询---------------------------------------------------------------------------------------------
<%
id=request("uid")
''set dbconnection=Server.CREATEOBJECT("ADODB.CONNECTION")
sql="select * from students where id ="&;id
Set rs=Server.CreateObject("ADODB.Recordset")
Set rs=conn.Execute(sql)
%>