主题:  请高手帮忙!!!在线等。。。。

yukeiv

职务:普通成员
等级:1
金币:0.0
发贴:35
#12005/7/31 19:45:22
我现在有一段程序调试有问题请高手帮忙看看。5D论坛做的真好,3年前我就是在5D论坛上高手给我解决了一个难题是关于财务的程序上显示没有“,”只是一个“.”我检查了5、6遍都没有发现错误。呵呵 说正题:这段程序如下:(一运行就说没有End)


<title>管理设备</title>
<%dim action,searchkey,categoryid,jiage,selectid
categoryid=Cint(request.form("categoryid"))
jiage=FormatSQL(request.form("jiage"))
action= FormatSQL(SafeRequest("action",1))
searchkey=FormatSQL(SafeRequest("searchkey",0))
if categoryid="" then categoryid= FormatSQL(SafeRequest("categoryid",1))
if jiage="" then jiage= FormatSQL(SafeRequest("jiage",1))
if action="" then action=Cint(request.form("action"))
if searchkey="" then searchkey=trim(request.form("searchkey"))
selectid=request.form("selectid")
if selectid<>"" then
if session("rank")>2 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权管理设备!');history.go(-1);</script>"
response.End
end if
conn.execute "delete from product where id in ("&selectid&")"
response.Redirect "chkpro.asp"
response.End
end if
%>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6699cc">
<tr>
<td align="center"><font color="#FFFFFF">设备查询</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<form name="form2" method="post" action="chkpro.asp">
<td>
<input name="searchkey" type="text" size="15" maxlength="15">
<select name="action" id="action">
<option value="1" selected>是否到货</option>
<option value="2" selected>买方合同</option>
</select>
<%set rs=server.CreateObject("adodb.recordset")
         rs.open "select * from category order by categoryorder",conn,1,1
         %>
<select name="categoryid">
<option value="0">所有分类</option>
<%do while not rs.eof%>
<option value="<%=rs("categoryid")%>"><%=trim(rs("category"))%></option>
<%rs.movenext
         loop
         rs.close
         set rs=nothing%>
</select>
<input type="submit" name="Submit2" value="查 找" onClick="return checkk();">
</td>
</form>
</tr>
</table><br>

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6699cc">
<tr>
<td height="20" align="center"><font color="#FFFFFF">设备查看与修改</font></td>
</tr>
<tr>

<td height="100" bgcolor="#FFFFFF">
<%
                Const MaxPerPage=20
                dim totalPut
                dim CurrentPage
                dim TotalPages
                dim j
                dim sql
                if Not isempty(SafeRequest("page",1)) then
                currentPage=Cint(SafeRequest("page",1))
                else
                currentPage=1
                end if
            set rs=server.CreateObject("adodb.recordset")
            if jiage=0 then '//普通查询
select case action
case "1"
rs.open "select * from product where nowyesor like '%"&searchkey&"%' ",conn,1,1
end select
else
'//高级查询
if categoryid<>0 then '//判断查询分类,分类不为空。
select case action
case "1"
rs.open "select * from product where nowyesor like '%"&searchkey&"%' and price2<"&jiage&" and categoryid="&categoryid,conn,1,1
end select
else
'//分类为空。
select case action
case "1"
rs.open "select * from product where nowyesor like '%"&searchkey&"%' and price2<"&jiage,conn,1,1
end select
             if err.number<>0 then
                response.write "数据库中暂时无数据"
                end if
                
                if rs.eof And rs.bof then
                Response.Write "<p align='center' class='contents'> 数据库中暂时无数据!</p>"
                else
                     totalPut=rs.recordcount

                if currentpage<1 then
                currentpage=1
                end if

                if (currentpage-1)*MaxPerPage>totalput then
                         if (totalPut mod MaxPerPage)=0 then
                         currentpage= totalPut \ MaxPerPage
                         else
                         currentpage= totalPut \ MaxPerPage + 1
                         end if
                end if

                if currentPage=1 then
            showContent
            showpage totalput,MaxPerPage,"chkpro.asp"
                else
                if (currentPage-1)*MaxPerPage<totalPut then
                rs.move (currentPage-1)*MaxPerPage
                dim bookmark
                bookmark=rs.bookmark
                showContent
                showpage totalput,MaxPerPage,"chkpro.asp"
                else
                     currentPage=1
                    showContent
                    showpage totalput,MaxPerPage,"chkpro.asp"
                     end if
                     end if
                                 end if

                sub showContent
            dim i
                 i=0%>
<table width="95%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF" align="center" height="20">
<td width="30%">设备名称</td>
<td width="45%">制造厂商</td>
<td width="17%">加入时间</td>
<td width="8%">选 择</td>
</tr>
<%
         do while not rs.eof%>
<tr bgcolor="#FFFFFF" align="center">
<td align="left">&nbsp;<a href=editpro.asp?id=<%=rs("id")%>>
<% if len(trim(rs("name")))>20 then
            response.write left(trim(rs("name")),18)&"..."
            else
            response.write trim(rs("name"))
            end if%>
</a></td>
<td align="left">&nbsp;
<%if len(trim(rs("introduce")))>30 then
            response.write left(trim(rs("introduce")),28)&"..."
            else
            response.write trim(rs("introduce"))
            end if%>
</td>
<td nowrap><%=rs("adddate")%></td>
<td align="center"><input name="selectid" type="checkbox" id="selectid" value="<%=rs("id")%>"></td>
</tr>
<%i=i+1
            if i>=MaxPerPage then Exit Do
            rs.movenext
         loop
         rs.close
         set rs=nothing%>
<tr bgcolor="#FFFFFF">
<td height="30" colspan="4" align="right">全选 <input type="checkbox" name="checkbox2" value="Check All" onClick="mm()">&nbsp;<input type="submit" name="Submit" value="删 除" onClick="return test();">
&nbsp;&nbsp; </td>
</tr>
</table>
<form method=Post action=<% = filename %>?searchkey=<% = searchkey %>&action=<% = action %>&categoryid=<% = categoryid %>&jiage=<% = jiage %>>
<p align="center"><%
                End Sub

                Function showpage(totalnumber,maxperpage,filename)
                Dim n
                
                If totalnumber Mod maxperpage=0 Then
                    n= totalnumber \ maxperpage
                Else
                    n= totalnumber \ maxperpage+1
                End If %> </p>
<%    If CurrentPage<2 Then %> <div align="center">首 页 上一页 <% Else %>
<div align="center"><a href=<% = filename %>?page=1&searchkey=<% = searchkey %>&action=<% = action %>&categoryid=<% = categoryid %>&jiage=<% = jiage %>>首
页</a> <a href=<% = filename %>?page=<% = CurrentPage-1 %>&searchkey=<% = searchkey %>&action=<% = action %>&categoryid=<% = categoryid %>&jiage=<% = jiage %>>上一页</a>
<%    End If
                If n-currentpage<1 Then %> 下一页 末 页 <%    Else %> <a href=<% = filename %>?page=<% = (CurrentPage+1) %>&searchkey=<% = searchkey %>&action=<% = action %>&categoryid=<% = categoryid %>&jiage=<% = jiage %>>下一页</a>
<a href=<% = filename %>?page=<% = n %>&searchkey=<% = searchkey %>&action=<% = action %>&categoryid=<% = categoryid %>&jiage=<% = jiage %>>末
页</a> <%    End If %> 第&nbsp;<b><% = CurrentPage %></b>&nbsp;页 共&nbsp;<b><% = n %></b>&nbsp;页
共查询到&nbsp;<b><% = totalnumber %></b>&nbsp;件设备 转到第
<input type="text" name="page" size=2 maxlength=10 value=<% = currentpage %>>

<input type='submit' class='contents' value='跳转' name='cndok'>
</div>
<%
                End Function
%>
<div align="center"></div></form>
</td></tr> </table>

编辑历史:[此帖最近一次被 清水无香 编辑过(编辑时间:2005-08-02 20:33:24)]


缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#22005/7/31 19:53:56
代码太长,没有办法看.



yukeiv

职务:普通成员
等级:1
金币:0.0
发贴:35
#32005/7/31 20:02:14
我把上段的代码大概的意思说一说:
就是一段查询:1、按设备名称等查询并且可以同时按大类、按价格查询然后把设备名称等列出来可以对设备进行编辑。2、有权限的用户还可以有删除权限。
 3、查询出的设备是进行分页的

我把上段的代码大概的意思说一说:
就是一段查询:1、按设备名称等查询并且可以同时按大类、按价格查询然后把设备名称等列出来可以对设备进行编辑。2、有权限的用户还可以有删除权限。
 3、查询出的设备是进行分页的

以下是运行结果:Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/wz/chkpro.asp,行198

编辑历史:[此帖最近一次被 清水无香 编辑过(编辑时间:2005-07-31 20:16:14)]


蓝鲸

职务:版主
等级:5
金币:42.1
发贴:2614
#42005/8/1 1:23:59
请帖上198行周围的代码,这里看不了错在什么地方


非常大鱼

yukeiv

职务:普通成员
等级:1
金币:0.0
发贴:35
#52005/8/1 20:36:51
End Function
这句就是198行的代码,就是最后几行的代码



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#62005/8/1 21:17:27
看看是不是少了一个end if,或者其他语句未结束



yukeiv

职务:普通成员
等级:1
金币:0.0
发贴:35
#72005/8/2 20:57:21
问题已经解决呵呵谢谢大家,有空我把它贴过来