插入数据代码如下:
<!--#include file="conn.asp"-->
<%
name=Replace(Request.Form("name"),"'","''")
zhuti=Replace(Request.Form("zhuti"),"'","''")
danwei=Replace(Request.Form("danwei"),"'","''")
tel=Replace(Request.Form("tel"),"'","''")
email=Replace(Request.Form("email"),"'","''")
time0=Replace(Request.Form("time"),"'","''")
content=Replace(Request.Form("content"),"'","''")
%>
<% if name="" or zhuti="" or content="" then
response.write"<script>alert('对不起,标明*的项为必填项,请填写完整,谢谢!');history.back(-1);</script>"
response.End()
end if%>
<%
set savely=cn.execute("insert into liuyan(name,zhuti,danwei,tel,email,time,content)values('"&name&"','"&zhuti&"','"&danwei&"','"&tel&"','"&email&"','"&time0&"','"content&"')")
%>
<%
set savely=nothing
%>
调试时总会出现如下错误:
错误类型:
Microsoft VBScript 编译器错误 (0x800A03EE)
缺少 ')'
/asp_qiye/insertdb.asp, line 16, column 162
set savely=cn.execute("insert into liuyan(name,zhuti,danwei,tel,email,time,content)values('"&name&"','"&zhuti&"','"&danwei&"','"&tel&"','"&email&"','"&time0&"','"body&"')")
(其中16行为set savely=cn.execute("insert into liuyan(name,zhuti,danwei,tel,email,time,content)values('"&name&"','"&zhuti&"','"&danwei&"','"&tel&"','"&email&"','"&time0&"','"content&"')")
我找了很久都找不出语法错误,不知道怎么改法?(另外本人数据库设计的主键是自动编号的)
希望各位能给予指点!谢谢!