回 帖 发 新 帖 刷新版面

主题:[求助]这段代码哪里错了.........

sub Modify()
    
    set shw=server.CreateObject("sdCrmSql.ShowValue")
    dim ID
    dim rs,sql
    ID=request("ID")
    if ID="" then
        FoundErr=true
        ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
        exit sub
    else
        ID=Clng(ID)
    end if

    Set rs=Server.CreateObject("Adodb.RecordSet")
    sql="select * from khgl where ID=" & ID
    if not IsObject(conn) then link_database
    rs.Open sql,Conn,1,1
    if rs.bof and rs.eof then
        FoundErr=true
        ErrMsg=ErrMsg & "<br><li>找不到指定的用户!</li>"
        rs.close
        set rs=nothing
        exit sub
    end if
    
    
%>


<form method="post" action="khgl.asp" name="formmod" onSubmit="javascript:return CheckEdit();" style="margin:0px;">  
<table width="95%" height="749" border="0" align="center" cellpadding="0" cellspacing="0" class="pageWidth">
  <tr>
    <td height="155" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="TableLine">
      <tr>
        <td height="27" bgcolor="#efefef"><div align="center" class="STYLE1">修改客户</div></td>
      </tr>
      <tr>
......
......
......
......
......(省略部分为修改页面)

      <tr>
        <td height="37" valign="top"><div align="center">
          <input name="Action" type="hidden" id="Action" value="SaveModify" />
          <input type="submit" name="Submit" value=" 修 改 " />
  &nbsp;&nbsp;
  <input name="Cancel" type="button" id="Cancel" value=" 取 消 " onclick="history.go(-1);" style="cursor:hand;" />
        </div></td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
<% 
    set shw=nothing  
end sub    

sub SaveModify()

    dim s1,s2,s3,s4,s5,s7,s9,s11,s12,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24
    dim corp_id,I_user_id,I_date,up_flag,del_flag,sp_flag
    dim ID
    dim rs,sql

    Action=trim(request("Action"))
    
    id=request("id")
    showmsg id
    if ID="" then
        FoundErr=true
        ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
        exit sub
    else
        ID=Clng(ID)
    end if

    Set rs=Server.CreateObject("Adodb.RecordSet")
    sql="select * from khgl where ID=" & ID
    if not IsObject(conn) then link_database
    rs.Open sql,Conn,1,1
    if rs.bof and rs.eof then
        FoundErr=true
        ErrMsg=ErrMsg & "<br><li>找不到指定的记录!</li>"
        rs.close
        set rs=nothing
        exit sub
    end if
    set rs=nothing
    
    
    's1=chksql(Request("s1"))
    s2=chksql(Request("s2"))
    s3=chksql(Request("s3"))
    s4=chksql(Request("s4"))    
    s5=chksql(Request("s5"))
    s6=chksql(Request("s6"))    
    s7=chksql(Request("s7"))
    s8=chksql(Request("s8"))    
    s9=chksql(Request("s9"))
    s10=chksql(Request("s10"))
    s11=chksql(Request("s11"))
    s12=chksql(Request("s12"))
    s13=chksql(Request("s13"))
    s14=chksql(Request("s14"))
    s15=chksql(Request("s15"))
    s16=chksql(Request("s16"))
    s17=chksql(Request("s17"))
    s18=chksql(Request("s18"))
    s19=chksql(Request("s19"))
    s20=chksql(Request("s20"))
    s21=chksql(Request("s21"))
    s22=chksql(Request("s22"))
    s23=chksql(Request("s23"))
    s24=chksql(Request("s24"))
    M_user_id=session("Crmloginid")
    M_date=get_date&get_time
    
    set bd=server.CreateObject("sdCrmSql.sqlBd")
    st1="s2='"& s2 &"',s3='"& s3 &"',s4='"& s4 &"',s5='"& s5 &"',s7='"& s7 &"',s8='"& s8 &"',"
    st1=st1 & "s9='"& s9 &"',s10='"& s10 &"',s11='"& s11 &"',s12='"& s12 &"',s13='"& s13 &"',s14='"& s14 &"',"
    st1=st1 & "s15='"& s15 &"',s16='"& s16 &"',s17='"& s17 &"',s18='"& s18 &"',s19='"& s19 &"',s20='"& s20 &"',"
    st1=st1 & "s21='"& s21 &"',s22='"& s22 &"',s23='"& s23 &"',s24='"& s24 &"',M_user_id='"& M_user_id &"',M_date='"& M_date &"'"
    st2=writebdtxt("客户管理","修改",id & st1)
    
    call bd.update_sql(1,"khgl",st1,"id="& id &"",0,st2)
    call bd.requery("khgl")
    set bd=nothing
    Response.Redirect "khgl.asp"
    showmsg st1

end sub



在修改页面中ID值能接收到,但在保存修改的过程(sub savemodify())中ID为空值!
急!!!在线等

回复列表 (共5个回复)

沙发

去掉SaveModify中的dim id

板凳

[quote]去掉SaveModify中的dim id[/quote]

大哥,不行呐 !!谢谢捧场!!!

3 楼

action="khgl.asp" 
改成
 action="khgl.asp?id=<%=request("id")%>" 

4 楼

[quote]action="khgl.asp" 
改成
 action="khgl.asp?id=<%=request("id")%>" 
[/quote]
谢谢!解决了!!!

5 楼

[quote][quote]action="khgl.asp" 
改成
 action="khgl.asp?id=<%=request("id")%>" 
[/quote]
谢谢!解决了!!![/quote]
高人!

我来回复

您尚未登录,请登录后再回复。点此登录或注册