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

我的这个语句怎么就不能更新数据库呢

wxm198427 发布于 2008-09-10 14:31, 479 次点击
各位大虾,我写了下面的一段代码,是把前面提交的信息写进对应的字段,代码如下:
<!--#include file="conn.asp"-->
<%
dim do_man,do_time,sql
do_time=trim(request.form("do_time"))
do_man=trim(request.form("do_man"))
if do_man<>"" and do_time<>"" then
sql="update [nd_msg] set [do_man]='"&do_man&"',[do_time]='"&do_time&"',[agn_type]='1' where [nd_data]='"&session("id")&"' and [nd_name]='"&session("nd_name")&"'"
conn.Execute sql
conn.close
set conn=nothing
response.write "您分配的任务已经提交!"
response.write "<a href='assigned_list_index.asp'>查看分配状态!"
response.end()
else
response.write "<Script language='JavaScript'>window.alert('您输入的任务执行人和时间不能为空,请返回重新输入!');history.back(-1);</Script>"
end if
%>


那就是怎么也不能修改数据库啊,比方说我提交了一下之后,数据库中的这三个字段就是没变啊,怎么回事啊,请各位大虾帮我看看!!!
2 回复
#2
孤独冷雨2008-09-10 14:34
检察一下你的session里有值不?
#3
wxm1984272008-09-10 14:54
谢谢提醒
楼上的大哥,我知道了,session中是有值,是我弄错了,为什么呢,我传那个id='"&session("id")&"'这个有问题知道吗,因为这个ID是自动编号的,所以有时会总提示有什么类型不匹配的情况,这个让我发现这个ASP有不稳定的情况或者说IIS不行,可能我说的不是很专业,但是我就是发现有不稳定的现象发生。谢谢你啊楼上的哥们!!!!
1