各位帅哥美女,求助,急!!!!!!!!!!
代码如下:
<%
bookname=Request.Form("name")
%>
<%
Dim conn,rst,strsql,dbpath
Set conn=Server.CreateObject("ADODB.Connection")
dbpath=Server.MapPath("test.mdb")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&dbpath
if conn.State=1 then
Set rst=Server.CreateObject("ADODB.Recordset")
strsql="insert into book(name) values('"&bookname&"')"
conn.execute strsql
conn.close
set conn=nothing
Response.Write("插入成功")
%>
<%
end if
%>
显示错误如下
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] 操作必须使用一个可更新的查询。
/diwuzhang/insert.asp, 第 21 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
网页:
GET /diwuzhang/insert.asp
<%
bookname=Request.Form("name")
%>
<%
Dim conn,rst,strsql,dbpath
Set conn=Server.CreateObject("ADODB.Connection")
dbpath=Server.MapPath("test.mdb")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&dbpath
if conn.State=1 then
Set rst=Server.CreateObject("ADODB.Recordset")
strsql="insert into book(name) values('"&bookname&"')"
Response.Write "<br>"&strsql&"<br>"
conn.execute strsql
conn.close
set conn=nothing
Response.Write("插入成功")
%>
<%
end if
%>