以下经典ASP代码在rsTemp.Bookmark = varCurrBookmark行上生成错误。这似乎是相当简单的代码,应该可行。请注意,我可以阅读书签,但无法设置它。此外,如果我取消注释该行并设置CursorLocation = 3(使用客户端)
,此代码将起作用ADODB.Recordset错误'800a0bb9'
参数类型错误,超出可接受的范围,或彼此冲突。
/app/TestBookMark.asp,第19行。
<html>
<body>
<%
strConn = "Provider=SQLOLEDB;Data Source=localhost\sqlexpress;Initial Catalog=db;User Id=uid;Password=pwd;"
Set objDataConn = Server.CreateObject("ADODB.Connection")
objDataConn.Open strConn
strQry = "SELECT * FROM tbl"
Set rsTemp = Server.CreateObject("ADODB.Recordset")
'rsTemp.CursorLocation = 3
rsTemp.Open strQry, objDataConn,3,1
lngRecordCount = rsTemp.RecordCount
varCurrBookmark = rsTemp.Bookmark
rsTemp.MoveLast
Response.Write rsTemp.Bookmark
Response.Write "<BR>"
rsTemp.Bookmark = varCurrBookmark
Response.Write varCurrBookmark
%>
</body>
</html>