标题:这个写法哪里有问题
取消只看楼主
kyou5478
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-4-5
 问题点数:0 回复次数:1 
这个写法哪里有问题
程序代码:
        set rs=server.CreateObject("adodb.recordset")
        if request2.form("id")="" then
            rsstr="select ppic from light where id="&request2.form("id")
            rs.open rsstr,conn,1,1
            if rs.recordcount=0 then
                rs.open "select * from light",conn,1,3
                rs.addnew
                rs("ppic")=request2.form("ppic")
                rs("pictime")=date()
                rs.update
            else
            response.write "<script language='javascript'>"
            response.write "alert('不能上传');"
            response.write "window.location.href='javascript:history.go(-1)';"
            response.write "</script>"
            end if
        end if


请教大神,这个哪里有问题
搜索更多相关主题的帖子: color 
2013-08-21 16:13
kyou5478
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-4-5
得分:0 
回复 2楼 hu9jj
程序代码:
if request2.form("id")<>"" then
    set rs=server.CreateObject("adodb.recordset")
    rsstr="select ppic from light where id="&request2.form("id")
    rs.open rsstr,conn,1,1
    if rs.recordcount=0 then
        set rss=server.CreateObject("adodb.recordset")
        rss.open "select * from light",conn,1,3
        rss.addnew
        rss("ppic")=request2.form("ppic")
        rss("pictime")=date()
        rss.update
        rss.close
        set rss=nothing
        
    else
        response.write "<script language='javascript'>"
        response.write "alert('不能上传');"
        response.write "window.location.href='modify.asp?id="&request2.form("id")&"';"
        response.write "</script>"
    end if
    rs.close
    set rs=nothing
end if


现在改过了,就是 rs.recordcount=0 的时候好像没有执行写入数据库,直接运行 else 部分了
2013-08-23 08:18



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




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

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