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

ADO
ADO DataTypes
ADO 摘要
ADO 实例

ADO BOF 与 EOF 属性


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

The BOF property returns True (-1) if the current record position is before the first record in the Recordset, otherwise it returns False (0).
如果当前记录指针位于记录集中的第一条记录之前,则返回True(-1);否则返回False(0)。

The EOF property returns True (-1) if the current record position is after the last record in the Recordset, otherwise it returns False (0).
如果当前记录指针位于记录集中的最后一条记录之后,则返回True(-1);否则返回False(0)。

Note: The BOF and EOF properties are set to True if you open an empty Recordset. RecordCount property is zero.
注意:如果你打开一个空的记录集,那么BOF和EOF属性都为True,此时,RecordCount属性为0。

Note: If a Recordset holds at least one record, the first record is the current and the BOF and EOF properties are False.
注意:如果一个记录集保留了至少一条记录,那么当前记录就是第一条记录,且此时BOF和EOF的属性值都为False。

Syntax
语法

objRecordset.BOF
or
objRecordset.EOF

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
%>
<table border="1" width="100%">
<%while rs.EOF=false%> <tr> <%for each x in rs.Fields%> <td><%Response.Write(x.value)%></td> <%next rs.MoveNext%> </tr>
<%wend
rs.close
conn.close
%>

评论 (0) All

登陆 | 还没注册?