标题:[求助]往ACCESS数据库中添加数据
取消只看楼主
xl0320
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2006-10-10
 问题点数:0 回复次数:0 
[求助]往ACCESS数据库中添加数据

插入数据代码如下:
<!--#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&"')")
我找了很久都找不出语法错误,不知道怎么改法?(另外本人数据库设计的主键是自动编号的)
希望各位能给予指点!谢谢!

搜索更多相关主题的帖子: 数据库 ACCESS 
2006-10-17 10:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-96857-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.378892 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved