翻页多参数(不定)传递问题!在线================

mjb001 2004-02-03 10:19:10
========================取值判断(共有6个参数)============================
sql="select * from fix_archives"
listsql="select * from fix_archives"
if strmach_no <> "" then
listsql=listsql&" where mach_no='"& strmach_no &"'"
end if

if strrwdh <> "" then
if sql<>listsql then
listsql=listsql&" and rwdh='"& strrwdh &"'"
else
listsql=listsql&" where rwdh='"& strrwdh &"'"
end if
end if

if strsummons_time <> "" then
if sql<>listsql then
listsql=listsql&" and summons_time='"& strsummons_time &"'"
else
listsql=listsql&" where summons_time='"& strsummons_time &"'"
end if
end if

if strcomplete_time <> "" then
if sql<>listsql then
listsql=listsql&" and complete_time='"& strcomplete_time &"'"
else
listsql=listsql&" where complete_time='"& strcomplete_time &"'"
end if
end if

=============================下面是三个下拉选择====================

if strsummons_type <> "-请选择-" then
if sql<>listsql then
listsql=listsql&" and summons_type='"& strsummons_type &"'"
else
listsql=listsql&" where summons_type='"& strsummons_type &"'"
end if
end if



if strfixer <> "-请选择-" then
if sql<>listsql then
listsql=listsql&" and fixer='"& strfixer &"'"
else
listsql=listsql&" where fixer='"& strfixer &"'"
end if
end if



if strmonth <> "-请选择-" then
if sql<>listsql then
listsql=listsql&" and month="& strmonth &""
else
listsql=listsql&" where month="& strmonth &""
end if
end if
%>
<%
response.Write listsql
rs.open listsql,conn,1,1
rs.pagesize=maxperpage
if trim(request("page"))<>"" then
currentpage=CLng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
if rs.Eof then
response.write"对不起!没有找到你要找的记录!"
else
totalput=rs.recordcount
if currentpage<>1 then
if (currentpage-1)*maxperpage<totalput then
rs.move(currentpage-1)*maxperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
dim n,k
if (totalput mod maxperpage)=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
%>
====================显示记录数====================================
第<font color=#0000ff><%=currentpage%></font>页/共<font color=#0000ff><%=n%></font>页----总计<font color=#0000ff><%=rs.recordcount%></font>条记录
<%
========================翻页======================================
k=currentpage
if k<>1 then
response.write"[<b>"+"<a href=look_fix.asp?page=1&mach_no='"& strmach_no &"'&rwdh='"& strrwdh &"'&summons_time='"& strsummons_time &"'&complete_time='"& strcomplete_time &"'&summons_type='"& strsummons_type &"'&fixer='"& strfixer &"'&month="& strmonth &">第一页</a></b>]"
response.write"[<b>"+"<a href=look_fix.asp?page="+cstr(k-1)+"&mach_no='"& strmach_no &"'&rwdh='"& strrwdh &"'&summons_time='"& strsummons_time &"'&complete_time='"& strcomplete_time &"'&summons_type='"& strsummons_type &"'&fixer='"& strfixer &"'&month="& strmonth &">上一页</a></b>]"
else
response.write"[第一页][上一页]"
end if
if k<>n then
response.write"[<b>"+"<a href=look_fix.asp?page="+cstr(k+1)+"&mach_no='"& strmach_no &"'&rwdh='"& strrwdh &"'&summons_time='"& strsummons_time &"'&complete_time='"& strcomplete_time &"'&summons_type='"& strsummons_type &"'&fixer='"& strfixer &"'&month="& strmonth &">下一页</a></b>]"
response.write"[<b>"+"<a href=look_fix.asp?page="+cstr(n)+"&mach_no='"& strmach_no &"'&rwdh='"& strrwdh &"'&summons_time='"& strsummons_time &"'&complete_time='"& strcomplete_time &"'&summons_type='"& strsummons_type &"'&fixer='"& strfixer &"'&month="& strmonth &">最后一页</a></b>]"
else
response.write"[下一页][最后一页]"
end if

第一页能正确的显示,但翻页就这样的问题:
select * from fix_archives where summons_type='' and fixer='' and month=

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'
ODBC 驱动程序不支持所需的属性。

而且页面地址是这样的:
http://server/wx/look_fix.asp?page=2&mach_no=''&rwdh=''&summons_time=''&complete_time=''&summons_type='-请选择-'&fixer='-请选择-'&month=-请选择-

很明显是参数没传过来!
请教如何处理!谢谢!
...全文
63 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
mjb001 2004-02-03
  • 打赏
  • 举报
回复
http://server/wx/look_fix.asp?page=2&mach_no=''&rwdh=''&summons_time=''&complete_time=''&summons_type='-请选择-'&fixer='-请选择-'&month=-请选择-

这样的错!
看来翻页不了!
nffly 2004-02-03
  • 打赏
  • 举报
回复
还是把下拉月份选择改成 字符 ,然后加‘’。
如果是数值型的,下面这样对不对?
if strmonth <> "-请选择-" then
if sql<>listsql then
listsql=listsql&" and month="& strmonth &""
else
listsql=listsql&" where month="& strmonth &""
end if
end if
nffly 2004-02-03
  • 打赏
  • 举报
回复
还是把下拉月份选择改成 字符 ,然后加‘’。
如果是数值型的,下面这样对不对?
if strmonth <> "-请选择-" then
if sql<>listsql then
listsql=listsql&" and month="& strmonth &""
else
listsql=listsql&" where month="& strmonth &""
end if
end if
nffly 2004-02-03
  • 打赏
  • 举报
回复
既然是数值行的
试试:
&month="+strmonth+"">
mjb001 2004-02-03
  • 打赏
  • 举报
回复
month是数值型的!所以不用加‘’了吧!我加了试了一下还是不行呀!
nffly 2004-02-03
  • 打赏
  • 举报
回复
&month='"& strmonth &"'">
mjb001 2004-02-03
  • 打赏
  • 举报
回复
我试了!还是同样的问题!
nffly 2004-02-03
  • 打赏
  • 举报
回复
取值后存到session里:
name=request("name")
session("name")=name

对每一个参数判断
if session("name")<>"" then
name=session("name")
end if
angelheavens 2004-02-03
  • 打赏
  • 举报
回复
&"'&month="& strmonth &">上一页
加参数及其值
mjb001 2004-02-03
  • 打赏
  • 举报
回复
还是参数传递问题!

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧