当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO Bookmark 属性

ADO
ADO DataTypes
ADO 摘要
ADO 实例

ADO Bookmark 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 379 ::
收藏到网摘: n/a

The Bookmark property specifies a bookmark. The bookmark saves the position of the current record.
Bookmark属性的作用是:制定一个书签。该书签将保存当前记录的指针位置。

To save the bookmark for the current record, assign the value of the Bookmark property to a variable. To return to the "bookmarked" record, set the Bookmark property to the value of that variable.
你可以在一个变量中指定一个书签值来保存当前记录指针;你也可以通过设置指定书签变量值来返回指向的记录。

Note: The Bookmark property is available only in Recordset objects that support bookmarks.
注意:书签属性仅可以在支持书签属性的记录集对象中使用。

Syntax
语法

objRecordset.Bookmark

Example
案例

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("northwind.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
sql="SELECT Companyname, Contactname FROM Customers"
rs.Open sql, conn
rs.MoveFirst
'Store bookmark of the current record
bkmark=rs.Bookmark
rs.MoveLast
'Go to the bookmarked record
rs.Bookmark=bkmark
rs.Close
conn.Close
%>

评论 (0) All

登陆 | 还没注册?