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

求助!页面打不开!看需要改哪里?谢谢

martialarts 发布于 2013-12-23 23:22, 557 次点击
帮忙看看这上页面

<%@ Language=VBScript %>
<% Response.Expires = 0 %>
<!-- #include file="../share/connectdb.asp"  -->
<%
mc=replace(Request.Form("mc"),"'","''")
sql="select * from zdgwlb where mc='" & mc & "'"
set rs=conn.execute(sql)
mc = Request.Form("mc")

if not rs.eof and not rs.bof then %>
   <P><font size="2" color="#FF0000" ><b>已有此名称类别,请返回重新填写!</b></font></p>
   <P><img src="images/fh.gif" width="67" height="22" border="0" onclick="javascript:history.back()" style="cursor:hand">
<% Response.End

else

set rs=nothing
   '求最大编号
   sql="select max(cInt(xh)) as id from zdgwlb"
   set rs=conn.execute(sql)
   
   if isnull(rs("id")) then
      id=1
   else
 
   '判断最大号是否为99
   if rs("id")=99 then
         
      sql="select * from zdgwlb where cint(xh)<99 order by xh asc"
      set rs1=conn.execute(sql)
      
     
      if rs1.eof and rs1.bof then
         id=1
      else      
         do while not rs1.eof
         
            aa=Cint(rs1("xh"))+1
            sql="select * from zdgwlb where cint(xh)=" & aa
            set rs2=conn.execute(sql)
            if rs2.bof and rs2.eof then
               id=aa
               exit do            
            else
               sql="select * from zdgwlb where cint(xh)=" & aa-1
               set rs3=conn.execute(sql)
               if rs3.bof and rs3.eof then
                  id=aa-2
                  exit do               
               end if        
               rs3.close
               set rs3=nothing            
            end if
            rs2.close
            set rs2=nothing         
            rs1.movenext
            loop
      end if
      rs1.close
      set rs1=nothing
   else
      id=rs("id")+1
   end if
   
   end if
   set rs=nothing
   
   if id="" or id<0 then %>
   <P><font size="2" color="#FF0000" ><b>类别数最大为99,无法再增加类别!</b></font></p>
<%
   Response.End
   end if
   
    '存入
    set rsSave=CreateObject("adodb.recordset")
    rsSave.Open "zdgwlb",Conn,3,2
    rsSave.AddNew
    rsSave("xh")=id
    rsSave("mc")=mc
    rsSave.Update
    rsSave.Close
    set rsSave=nothing


   '刷新显示
   
    Response.Redirect "lb_weihu.asp"

set rs=nothing
Conn.Close
Set Conn = Nothing

end if
%>
1 回复
#2
martialarts2013-12-26 12:42
问题已经解决!不好意思,我发现是里面用到的参数我都没有定义!
在<%dim mc,xh....后问题解决!
1