请大家帮我看一下错误在哪??????
错误类型:
Microsoft VBScript 编译器错误 (0x800A0401)
语句未结束
/glsk/admin/online_sava.asp, line 61, column 516
sql="insert into online(name,man_age,man_work,phone,address,post,c1,woman_age,woman_work,c2,num,c3,hb,see_year,see_month,see_day,hospital,c4,week_num,c5,yijing,c6,baopi,length,r_fore,r_mid,r_behind,yinjingqian,yjq_length,yjq_r,c7,c8,c9,c10,c11,c12,c13,c14,c15,gw_left,gw_right,c16,c17,c18,c19,bn_other,c20,other,bing,bing_year,c21,yao,guoming,content,addtime) values('"&name&"','"&man_age&"','"&man_work&"','"&phone&"','"&address&"','"&post&"','"&c1&"','"&woman_age&"','"&woman_work&"','"&c2&"','"&num&"','"&c3&"','"&hb&"','"&see_year&"','"&see_month&"','"&see_day&"','"&hospital&"','"&c4&"','"&week_num&"','"&c5&"','"&yijing&"','"&c6&"','"&baopi&"','"&length&"','"&r_fore&"','"&r_mid&"','"&r_behind&"','"&yinjingqian&"','"&yjq_length&"','"&yjq_r&"','"&c7&"','"&c8&"','"&c9&"','"&c10&"','"&c11&"','"&c12&"','"&c13&"','"&c14&"','"&c15&"','"&c16&"','"&c17&"','"&c18&"','"&c19&"','"&bn_other&"','"&c20&"','"&other&"','"&bing&"','"&bing_year&"','"&c21&"','"&yao&"','"&guoming&"','"&content&"','"&addtime&"')"
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
<%
name=request("name")
man_age=request("man_age")
man_work=request("man_work")
phone=request("phone")
address=request("address")
post=request("post")
c1=request("c1")
woman_age=request("woman_age")
woman_work=request("woman_work")
c2=request("c2")
num=request("num")
c3=request("c3")
hb=request("hb")
see_year=request("see_year")
see_month=request("see_month")
see_day=request("see_day")
hospital=request("hospital")
c4=request("c4")
week_num=request("week_num")
c5=request("c5")
yijing=request("yijing")
c6=request("c6")
baopi=request("baopi")
length=request("length")
r_fore=request("r_fore")
r_mid=request("r_mid")
r_behind=request("r_behind")
yinjingqian=request("yinjingqian")
yjq_length=request("yjq_length")
yjq_r=request("yjq_r")
c7=request("c7")
c8=request("c8")
c9=request("c9")
c10=request("c10")
c11=request("c11")
c12=request("c12")
c13=request("c13")
c14=request("c14")
c15=request("c15")
gw_left=request("gw_left")
gw_right=request("gw_right")
c16=request("c16")
c17=request("c17")
c18=request("c18")
c19=request("c19")
bn_other=request("bn_other")
c20=request("c20")
other=request("other")
bing=request("bing")
bing_year=request("bing_year")
c21=request("c21")
yao=request("yao")
guoming=request("guoming")
content=request("content")
addtime=now()
set rs=server.createobject("adodb.recordset")
conn = "DBQ=" + server.mappath("../data.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="insert into online(name,man_age,man_work,phone,address,post,c1,woman_age,woman_work,c2,num,c3,hb,see_year,see_month,see_day,hospital,c4,week_num,c5,yijing,c6,baopi,length,r_fore,r_mid,r_behind,yinjingqian,yjq_length,yjq_r,c7,c8,c9,c10,c11,c12,c13,c14,c15,gw_left,gw_right,c16,c17,c18,c19,bn_other,c20,other,bing,bing_year,c21,yao,guoming,content,addtime) values('"&name&"','"&man_age&"','"&man_work&"','"&phone&"','"&address&"','"&post&"','"&c1&"','"&woman_age&"','"&woman_work&"','"&c2&"','"&num&"','"&c3&"','"&hb&"','"&see_year&"','"&see_month&"','"&see_day&"','"&hospital&"','"&c4&"','"&week_num&"','"&c5&"','"&yijing&"','"&c6&"','"&baopi&"','"&length&"','"&r_fore&"','"&r_mid&"','"&r_behind&"','"&yinjingqian&"','"&yjq_length&"','"&yjq_r&"','"&c7&"','"&c8&"','"&c9&"','"&c10&"','"&c11&"','"&c12&"','"&c13&"','"&c14&"','"&c15&"','"&c16&"','"&c17&"','"&c18&"','"&c19&"','"&bn_other&"','"&c20&"','"&other&"','"&bing&"','"&bing_year&"','"&c21&"','"&yao&"','"&guoming&"','"&content&"','"&addtime&"')"
rs.open sql,conn,1,1
set rs=nothing
set conn=nothing
response.redirect"online_mod.asp"
%>
问题点数:0、回复次数:4Top
1 楼chinaworker(网络混混 bokele.com)回复于 2004-04-04 00:48:15 得分 0
一本天书Top
2 楼pizixt(皮子)回复于 2004-04-04 00:50:04 得分 0
1、conn = "DBQ=" + server.mappath("../data.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" ????
2、所有字段都是字符型?都需要单引号吗?
3、提交数据含有单双引号会报错:语句未结束
4、建议换rs.addnew
Top
3 楼Ranmei(转向java)回复于 2004-04-04 00:57:38 得分 0
response.write sql 看看有什么问题...
你的sql语句太长了,耐心点检查...Top
4 楼renniliao(小a)回复于 2004-04-04 08:19:32 得分 0
错误提示是什么?不过从你的代码来看,很可能是你的insert语句出了问题,因为你的字段太多了。建议你看看pizixt(皮子)说的那几条。还有就是添加的记录的每个字段的值都合法么?
比如数据类型、是否为空等等。Top




