asp 数据库更新不进去

代码如下:tid=request("tid")iftid<>""thenfield1=array("xm","xb","sr","jg","mz","gzsj","zzm... 代码如下:
tid =request("tid")
if tid <> "" then
field1=array("xm","xb","sr","jg","mz","gzsj","zzmm","xl","drsj","ygxs","hyzk","jkzk","ryfl","da","sfz","xxzz","sf","lxdh","zp")
value1=array(xm,xb,sr,jg,mz,gzsj,zzmm,xl,drsj,ygxs,hyzk,jkzk,ryfl,da,sfz,xxzz,sf,lxdh,zp)
sql1="UPDATE rensi_base SET "

for i=0 to ubound(field1)
sql1 = sql1 & field1(i) & "='" & replace(value1(i),"'","''") & "'"
if i <> ubound(field1) then
sql1=sql1 & ","
else
sql1=sql & " where tid=" & tid
end if
next

field2=array("study","working","fanly")
value2=array(study,working,fanly)
sql2="UPDATE study_working_fanly SET "
for i=0 to ubound(field2)
sql2 = sql2 & field2(i) & "='" & replace(value2(i),"'","''") & "'"
if i <> ubound(field2) then
sql2=sql2 & ","
else
sql2=sql2 & " where tid=" & tid
end if
next

field3=array("wy","slcd","jsjsp","ah","jcjl","gwbdjl","bz")
value3=array(wy,slcd,jsjsp,ah,jcjl,gwbdjl,bz)
sql3="UPDATE rensi_other SET "

for i=0 to ubound(field3)
sql3 = sql3 & field3(i) & "='" & replace(value3(i),"'","''") & "'"
if i <> ubound(field3) then
sql3=sql3 & ","
else
sql3=sql3 & " where tid=" & tid
end if
next
end if

conn.Execute sql1
conn.Execute sql2
conn.Execute sql3

前两句SQL 都能进数据库,但是sql3不能进,求指教
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e57'
[Microsoft][ODBC SQL Server Driver][SQL Server]将截断字符串或二进制数据。
/myrenshi/rensi_base_edit.asp,行 109

报错这个
展开
 我来答
cometerrycz168
推荐于2016-01-19 · TA获得超过905个赞
知道小有建树答主
回答量:388
采纳率:0%
帮助的人:156万
展开全部
1. 建议你在调试网页时,先将
on error resume next
去掉,因为你在第三行加了这句,导致你的网页错误信息被掩盖,所以出了错都找不到原因。

2. 去掉后看看网页上的错误提示,再对症下药就解决了。
初步判断,应该是 SQL 语法错误,其中多了一个逗号,将它去掉,即改成:
conn.execute "insert into fan (username) values('" & username & "')"

username 后的逗号要去掉!

________________________________________________________________

建议将conn.open connstr,1,3
修改成
conn.open connstr, 3, 3
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式