注册 登录
编程论坛 ASP技术论坛

求求各位大虾看看!!!

wxm198427 发布于 2008-09-08 16:38, 462 次点击
下面这段语句我不知道是哪出了问题,说什么数据类型不匹配?????
<!--#include file="conn.asp"-->
<html>
<body><%
dim do_man,do_time,sql
do_time=trim(request.form("do_time"))
do_man=trim(request.form("do_man"))
if do_man<>"" then
sql="update [nd_msg] set [do_man]='"&do_man&"',[do_time]='"&do_time&"',[agn_type]='1' where [id]='"&session("id")&"' and [nd_name]='"&session("nd_name")&"'"
conn.Execute sql
conn.close
set conn=nothing
else
response.write "<Script language='JavaScript'>window.alert('您输入的任务执行人不能为空,请返回重新输入!');history.back(-1);</Script>"
end if
%>
</body>
</html>
报错地方是SQL,还有下面的那个conn.execute sql
请各位大虾赐教!!!!!
4 回复
#2
2008-09-08 16:41
是不是数字加了引号
#3
wxm1984272008-09-08 16:50
楼上的哥们
你对了,我试了下,就是那个'"&session("id")&"'出了问题,那你说我从前面传过来的ID怎么表示呢,我前面是这样的,我把那个ID就这样保存了,session("id")=rs("id"),那从这样说这个肯定是错误的,但是请哥们赐教,那要怎么样保存这个ID呢,再把她传过来那,这个语句又改怎么写呢?还望赐教!!!
#4
tianyu1232008-09-08 19:21
session("id")=rs("id") 这样是对的

你的错误是出现在语法上

数字型 不加引号

字符型 加引号
#5
anlige2008-09-08 23:43
sql="update [nd_msg] set [do_man]='"&do_man&"',[do_time]='"&do_time&"',[agn_type]=1 where [id]="&session("id")&" and [nd_name]='"&session("nd_name")&"'"
1