关于asp的问题.跪求帮忙啊..

来源:百度知道 编辑:UC知道 时间:2024/06/17 23:09:53
这是一个要执行删除的asp.可是一运行就错误:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] 参数不足,期待是 1。
/example7/example7.asp, 第 5 行

网页内容如下:
example7.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<form name="form1" method="post" action="example7.asp">
delete:
<input type="text" name="

example7.asp
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("example3.mdb")
exec="delete * from guestbook where id="&request.form("id")
conn.execute exec
%>
中的exec="delete * from guestbook where id="&request.form("id")
有问题,request.form("id")
怀疑request.form("id")是空值
建议改为:
dim id
id=trim(request("id"))
if id="" then
response.write "ID为空"
resposne.end
end if
exec="delete * from guestbook where id="&id

conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("example3.mdb")
改为
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("example3.mdb")

楼上两位说得对
1、数据库链接推荐使用这样的
conn.op