网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: ADO :: ADO Bookmark 属性

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

ADO Bookmark 属性


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:1286 :: ::

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