ADODB.Recordset对象在分页处理中的问题
问题描述: 调用存储过程返回临时表的进行分页处理时,出现错误“当前记录集不支持书签。这可能是提供程序或选定的游标类型的限制。” 代码如下: set comm = Server.CreateObject("ADODB.COMMAND") comm.CommandText = "keywordcount"''''过程名 comm.CommandType = 4''''4表示为存储过程 set comm.activeconnection=conn comm.Parameters.Append comm.CreateParameter("tseek",advarchar,adParamInput,50,keyword) comm.parameters.append comm.createparameter("counts",adinteger,adparamoutput,4,counts) comm.execute() counts=comm("counts") set rs=comm.Execute()
问题原因: 未使用客户端游标的方式打开记录集。将代码修改如下即可:set comm = Server.CreateObject("ADODB.COMMAND") comm.CommandText = "keywordcount"''''过程名 comm.CommandType = 4''''4表示为存储过程 set comm.activeconnection=conn comm.Parameters.Append comm.CreateParameter("tseek",advarchar,adParamInput,50,keyword) comm.parameters.append comm.createparameter("counts",adinteger,adparamoutput,4,counts) comm.execute() counts=comm("counts") ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''从这里开始修改为下面的 set rs=Server.CreateObject("ADODB.Recordset") rs.CursorLocation = 3 rs.open comm
原帖地址
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18