📄 ado_ref_recordset.asp@output=print
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ADO Recordset Object</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />
<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</head>
<body>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
<h1>ADO Recordset Object</h1>
<a href="ado_ref_record.asp"><img border="0" src="../images/btn_previous.gif" alt="prev" width="100" height="20" /></a>
<a href="ado_ref_stream.asp"><img border="0" src="../images/btn_next.gif" alt="next" width="100" height="20" /></a>
<hr />
<h2>Examples</h2>
<p><a target="_blank" href="showasp.asp@filename=demo_ado_getrows">GetRows</a><br />
This example demonstrates how to use the GetRows method.</p>
<hr />
<h2>Recordset Object</h2>
<p>The ADO Recordset object is used to hold a set of records from a database table.
A Recordset object consist of records and columns (fields).</p>
<p>In ADO, this object is the most important and the one used most often to
manipulate data from a database.</p>
<h3>ProgID</h3>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
<tr valign="top">
<td valign="top">
<pre>set objRecordset=Server.CreateObject("ADODB.recordset")</pre>
</td>
</tr>
</table>
<br />
When you first open a Recordset, the current record pointer will point to the first record and the BOF and EOF properties are
False. If there are no records, the BOF and EOF property are True.
<p>Recordset objects can support two types of updating: </p>
<ul>
<li><b>Immediate updating</b> - all changes are written immediately to the
database once you call the Update method.</li>
<li><b>Batch updating</b> - the provider will cache multiple changes and then
send them to the database with the UpdateBatch method.</li>
</ul>
<p>In ADO there are 4 different cursor types defined:</p>
<ul>
<li><b>Dynamic cursor</b> - Allows you to see additions, changes, and deletions by other
users.</li>
<li><b>Keyset cursor - </b>Like a dynamic cursor, except that
you cannot see additions by other users, and it prevents access to records that other users
have deleted. Data changes by other users will still be visible.</li>
<li><b>Static cursor </b>- Provides a static copy of a recordset for you to use to find data or generate
reports. Additions, changes, or deletions by other users will not be visible. This is the only type of cursor allowed when you open a client-side Recordset object.</li>
<li><b>Forward-only cursor </b>- Allows you to only scroll forward through the Recordset. Additions, changes, or deletions by other users will not be visible. </li>
</ul>
<p>The cursor type can be set by the CursorType property or by the CursorType
parameter in the Open method.</p>
<p><b>Note:</b> Not all providers support all methods or properties of the Recordset
object.</p>
<hr />
<h3>Properties</h3>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
<tr valign="top">
<th width="35%" align="left" valign="top">Property</th>
<th width="65%" align="left" valign="top">Description</th>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_absolute.asp">AbsolutePage</a></td>
<td valign="top">Sets or returns a value that specifies the page number in
the Recordset object</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_absolute.asp">AbsolutePosition</a></td>
<td valign="top">Sets or returns a value that specifies the ordinal position
of the current record in the Recordset object</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_active.asp">ActiveCommand</a></td>
<td valign="top">Returns the Command object associated with the Recordset</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_active.asp">ActiveConnection</a></td>
<td valign="top">Sets or returns a definition for a connection if the connection is closed,
or the current Connection object if the connection is open</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_bofeof.asp">BOF</a></td>
<td valign="top">Returns true if the current record position is before the first record, otherwise false</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_bookmark.asp">Bookmark</a></td>
<td valign="top">Sets or returns a bookmark. The bookmark saves the position of the current record</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_cachesize.asp">CacheSize</a></td>
<td valign="top">Sets or returns the number of records that can be cached</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_cursorlocation.asp">CursorLocation</a></td>
<td valign="top">Sets or returns the location of the cursor service</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_cursortype.asp">CursorType</a></td>
<td valign="top">Sets or returns the cursor type of a Recordset object</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_datamember.asp">DataMember</a></td>
<td valign="top">Sets or returns the name of the data member that will be
retrieved from the object referenced by the DataSource property</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_datasource.asp">DataSource</a></td>
<td valign="top">Specifies an object containing data to be represented as a Recordset object</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_editmode.asp">EditMode</a></td>
<td valign="top">Returns the editing status of the current record</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_bofeof.asp">EOF</a></td>
<td valign="top">Returns true if the current record position is after the last record, otherwise false</td>
</tr>
<tr>
<td valign="top"><a href="prop_rs_filter.asp">Filter</a></td>
<td valign="top">Sets or returns a filter for the data in a Recordset object</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_index.asp">Index</a></td>
<td valign="top">Sets or returns the name of the current index for a
Recordset object</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_locktype.asp">LockType</a></td>
<td valign="top">Sets or returns a value that specifies the type of locking
when editing a record in a Recordset</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_marshaloptions.asp">MarshalOptions</a></td>
<td valign="top">Sets or returns a value that specifies which records are to
be returned to the server</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_maxrecords.asp">MaxRecords</a></td>
<td valign="top">Sets or returns the maximum number of records to return to a Recordset object from a query</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_pagecount.asp">PageCount</a></td>
<td valign="top">Returns the number of pages with data in a Recordset object</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_pagesize.asp">PageSize</a></td>
<td valign="top">Sets or returns the maximum number of records allowed on a
single page of a Recordset object</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_recordcount.asp">RecordCount</a></td>
<td valign="top">Returns the number of records in a Recordset object</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_sort.asp">Sort</a></td>
<td valign="top">Sets or returns the field names in the Recordset to sort on</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_source.asp">Source</a></td>
<td valign="top">Sets a string value or a Command object reference, or
returns a String value that indicates the data source of the Recordset
object</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_state.asp">State</a></td>
<td valign="top">Returns a value that describes if the Recordset object is
open, closed, connecting, executing or retrieving data</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_status.asp">Status</a></td>
<td valign="top">Returns the status of the current record with regard to
batch updates or other bulk operations</td>
</tr>
<tr valign="top">
<td valign="top"><a href="prop_rs_stayinsync.asp">StayInSync</a></td>
<td valign="top">Sets or returns whether the reference to the child records
will change when the parent record position changes</td>
</tr>
</table>
<h3>Methods</h3>
<table class="ex" cellspacing="0" border="1" width="100%" cellpadding="3">
<tr valign="top">
<th width="35%" align="left" valign="top" height="19">Method</th>
<th width="65%" align="left" valign="top" height="19">Description</th>
</tr>
<tr>
<td valign="top" height="19"><a href="met_rs_addnew.asp">AddNew</a></td>
<td valign="top" height="19">Creates a new record</td>
</tr>
<tr>
<td valign="top" height="19"><a href="met_rs_cancel.asp">Cancel</a></td>
<td valign="top" height="19">Cancels an execution</td>
</tr>
<tr>
<td valign="top" height="19"><a href="met_rs_cancelbatch.asp">CancelBatch</a></td>
<td valign="top" height="19">Cancels a batch update</td>
</tr>
<tr>
<td valign="top" height="19"><a href="met_rs_cancelupdate.asp">CancelUpdate</a></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -