为什么我的Rs.PageCount=-1?
正面是我的一段代码,结果执行之后,Rs.PageCount=-1 这是为什么啊?
Conn.connectionstring="Provider=SQLOLEDB.1;UID=sa;PWD=;Initial Catalog=Northwind;Data Source=ZLZ"
Conn.connectiontimeout=30
Conn.open
if err.number>0 then
response.Write("数据库错误" & err.description & err.Number & "
")
end if
StrSQL="SELECT * FROM Products"
rs.open StrSQL,Conn,adOpenDynamic,adLockOptimistic,adCmdText
if err.number>0 then
response.Write("数据库错误" & err.description & err.Number & "
")
end if
rs.pagesize=4
Page=Clng(request("Page"))
if Page<1 then Page=1
if Page>rs.pagecount then page=rs.pagecount