Set rs = Server.CreateObject("ADODB.Recordset")
Rs.CursorLocation = 3 '服务器返回到客户端的记录集的游标类型设置成'客户端游标'
rs.Open "proc_tel_feature '"&feature&"','"&startprice&"','"&endprice&"','"&pinpai&"'",conn,1,3
'rs.Open "exec proc_tel_feature '" & feature & "'," & startprice & "," & endprice & ",'" & pinpai & "'",conn,1,3
intTotalRecords = rs.RecordCount '行67
rs.PageSize = intPageSize
intTotalPages = rs.pagecount
If intCurrentPage > intTotalPages Then intCurrentPage = intTotalPages
If intTotalRecords > 0 Then rs.AbsolutePage = intCurrentPage
--下面是存储过程
ALTER proc [dbo].[proc_tel_feature](@feature varchar(20),@sprice int,@eprice int,@pinpai varchar(50))
as
set nocount on
begin
if @feature='' and @pinpai='' and @eprice=0
begin
select * from tel order by Thaoma
end
else if @feature='' and @pinpai='' and @eprice<>0
begin
select * from tel where Ttest1>=@sprice and Ttest1<=@eprice order by Thaoma
end
else if @feature='' and @pinpai<>'' and @eprice=0
begin
select * from tel where tpinpai=@pinpai order by Thaoma
end
else if @feature='' and @pinpai<>'' and @eprice<>0
begin
select * from tel where tpinpai=@pinpai
and Ttest1>=@sprice and Ttest1<=@eprice order by Thaoma
end
else if @feature<>'' and @pinpai='' and @eprice=0
begin
if @feature='AABB'
begin
select * from tel where SUBSTRING(thaoma,8,1)=SUBSTRING(thaoma,9,1)
and SUBSTRING(thaoma,10,1)=SUBSTRING(thaoma,11,1)
and SUBSTRING(thaoma,8,1)!=SUBSTRING(thaoma,11,1)
end
else if @feature='ABAB'
begin
select * from tel where SUBSTRING(thaoma,8,2)=SUBSTRING(thaoma,10,2)
and SUBSTRING(thaoma,8,1)!=SUBSTRING(thaoma,11,1)
end
else if @feature='AAAB'
begin
select * from tel where SUBSTRING(thaoma,8,1)=SUBSTRING(thaoma,9,1)
and SUBSTRING(thaoma,9,1)=SUBSTRING(thaoma,10,1)
and SUBSTRING(thaoma,8,1)!=SUBSTRING(thaoma,11,1)
end
else if @feature='ABBB'
begin
select * from tel where SUBSTRING(thaoma,9,1)=SUBSTRING(thaoma,10,1)
and SUBSTRING(thaoma,11,1)=SUBSTRING(thaoma,10,1)
and SUBSTRING(thaoma,8,1)!=SUBSTRING(thaoma,11,1)
end
else if @feature='AAAA'
begin
select * from tel where SUBSTRING(thaoma,8,2)=SUBSTRING(thaoma,10,2)
and SUBSTRING(thaoma,8,1)=SUBSTRING(thaoma,11,1)
end
else if @feature='ABABAB'
begin
select * from tel where SUBSTRING(thaoma,6,2)=SUBSTRING(thaoma,8,2)
and SUBSTRING(thaoma,8,2)=SUBSTRING(thaoma,10,2)
end
else if @feature='AABBCC'
begin
select * from tel where SUBSTRING(thaoma,6,1)=SUBSTRING(thaoma,7,1)