通过调用存储过程来查询数据并实现分页,源代码如下:
set objRS=server.CreateObject("ADODB.RecordSet")
objRS.CursorLocation=adUseClient
objRS.CursorType=adOpenStatic
objrs.CacheSize=intPageSize
set objCmd=server.CreateObject("ADODB.Command")
objCmd.CommandText="GetDocuments"
objCmd.CommandType=adCmdStoredProc
set objCmd.ActiveConnection=objconn
if strDept<>"" then
set objParam=objCmd.CreateParameter("@Dept",adVarChar,adParamInput,200,strDept)
objCmd.Parameters.Append objParam
end if
if strKeywords<>"" then
set objParam=objcmd.createParameter("@Keywords",adVarChar,adparaminput,200,strKeywords)
objcmd.parameters.append objParam
end if
set objrs=objCmd.Execute
objrs.PageSize=intPageSize
intTotalPages=objrs.PageCount
if not objrs.Eof then
if IsEmpty(strPage) then
intCurrentPage=1
else
intCurrentPage=Cint(strPage)
end if
objrs.AbsolutePage=intCurrentPage '错误的行
end if
运行出错,错误信息如下:
ADODB.Recordset 错误 '800a0cb3'
当前 Recordset 不支持书签。这可能是提供者或选定的光标类型限定的。
/Jsbzb/Docenter.asp,行302
各位看一下问题出在哪,如何解决?
---------------------------------------------------------------
http://expert.csdn.net/Expert/topic/1309/1309995.xml?temp=.3773767
---------------------------------------------------------------
objrs.CursorType=3
---------------------------------------------------------------
http://expert.csdn.net/Expert/topic/1383/1383814.xml?temp=.5798914
可惜象楼上兄弟所说的语句objrs.CursorType=3楞是没有弄明白,请高手帮忙
---------------------------------------------------------------
objrs.CursorType=1 可以吧