当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO Bookmark 属性
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.
注意:书签属性仅可以在支持书签属性的记录集对象中使用。
objRecordset.Bookmark |
<% 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 %> |