<%
dim i,intPage,page,pre,last,filepath
set rs=server.createobject("adodb.recordset")
sql="select corp_info.*,calling_info.*,corp_info.id as corp_info_id from corp_info,calling_info where calling_info.corp_calling=corp_info.corp_calling "
if trim(request("corp_calling"))<>"" then
sql=sql&" and corp_info.corp_calling='"&trim(request("corp_calling"))&"' "
end if
if trim(request("corp_danwei"))<>"" then
sql=sql&" and corp_info.corp_danwei='"&trim(request("corp_danwei"))&"' "
end if
if trim(request("rongzi_leixing"))<>"" then
sql=sql&" and corp_info.rongzi_leixing='"&trim(request("rongzi_leixing"))&"' "
end if
sql=sql&" order by corp_info.id"
'增加变量
instring="?" '连接串的类型
pagestr="browse.asp" '跳转的地址
if trim(request("corp_calling"))<>"" then '判断相应的参数是否为空,以方便跳转的时候携带
pagestr=pagestr&instring&"corp_calling="&trim(request("corp_calling"))
instring="&"
end if
if trim(request("corp_danwei"))<>"" then
pagestr=pagestr&instring&"corp_danwei="&trim(request("corp_danwei"))
instring="&"
end if
if trim(request("rongzi_leixing"))<>"" then
pagestr=pagestr&instring&"corp_danwei="&trim(request("rongzi_leixing"))
instring="&"
end if
rs.PageSize = 30
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))'变量是跳转页面时的值
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
'### 下边是SQL代码,包括本页的一些查询条件
<%
dim i,intPage,page,pre,last,filepath
set rs=server.createobject("adodb.recordset")
sql="select corp_info.*,calling_info.*,corp_info.id as corp_info_id from corp_info,calling_info where calling_info.corp_calling=corp_info.corp_calling "
if trim(request("corp_calling"))<>"" then
sql=sql&" and corp_info.corp_calling='"&trim(request("corp_calling"))&"' "
end if
if trim(request("corp_danwei"))<>"" then
sql=sql&" and corp_info.corp_danwei='"&trim(request("corp_danwei"))&"' "
end if
if trim(request("rongzi_leixing"))<>"" then
sql=sql&" and corp_info.rongzi_leixing='"&trim(request("rongzi_leixing"))&"' "
end if
sql=sql&" order by corp_info.id"
rs.PageSize = 30
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))'变量是跳转页面时的值
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>