关于ASP与ACCESS数据 的 删除和修改???,请高手帮忙! !

来源:百度知道 编辑:UC知道 时间:2024/05/26 19:33:08
我有一个21.,asp如下:

<%
CurPageName=Request.servervariables("SCRIPT_NAME")
set conn=Server.CREATEOBJECT("ADODB.CONNECTION")
DBPath=Server.MapPath("..\common\DataBase\pgc.mdb")
conn="PROVIDER=Microsoft.JET.OLEDB.4.0;Data Source=" & DBPath
Set RS = Server.CreateObject("ADODB.Recordset")
sql="select * from ddmxb"
RS.open sql,conn,1,1
%>
<%
rs.pagesize=20
zongye=rs.pagecount
recordset 对象数据的页数
page=int(request("page"))
if page<=0 then page=1
if request("page")="" then page=1
rs.absolutepage=page
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>定单资料查询</title>
<table width="2000" border="0" cellpadding="5" cells

del.asp 忘了把连接打开了,变量写重了一个
<%
set conn=Server.CREATEOBJECT("ADODB.CONNECTION")
DBPath=Server.MapPath("..\common\DataBase\pgc.mdb")
connstr="PROVIDER=Microsoft.JET.OLEDB.4.0;Data Source=" & DBPath
conn.open connstr
dim id
id=request.querystring("id")
str="delete from ddmxb where id='"&id&"'"
conn.execute(str)
%>

edit21.asp
<%
set conn=Server.CREATEOBJECT("ADODB.CONNECTION")
DBPath=Server.MapPath("..\common\DataBase\pgc.mdb")
connstr="PROVIDER=Microsoft.JET.OLEDB.4.0;Data Source=" & DBPath
conn.open connstr
dim id
id=request.querystring("id")
str="select * from ddmxb where id='"&id&"'"
set rs=server.createobject("adodb.recordset")
rs.open str,conn,1,1
session("id")=rs("id&qu