|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><!-- InstanceBegin template="/templates/function.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Database Objects</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<link href="default.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1>
<h1><!-- InstanceBeginEditable name="heading" -->DatabaseObjects<!-- InstanceEndEditable --></h1>
<h3><!-- InstanceBeginEditable name="subheader" -->ObjectByOrdinal(<span class="keyword">ByVal</span> objCollection
<span class="keyword">As</span> IDatabaseObjects,
<span class="keyword">ByVal</span> lngIndex <span class="keyword">As</span> Long) <span class="keyword">As</span> IDatabaseObject<!-- InstanceEndEditable --><br>
</h3>
</h1>
<!-- InstanceBeginEditable name="text" -->
<p>ObjectByOrdinal returns an object from the collection at a specific ordinal/index
position. The ordinal position is
related to the collection's <a href="IDatabaseObjects_OrderBy.htm">IDatabaseObjects_OrderBy</a> value.
Typically, this function is used to enumerate through a collection of objects.
ObjectByOrdinal will load the
collection's
entire recordset on
the
first call
and on subsequent
calls any objects are loaded using the pre-loaded recordset. Avoid making calls
to ObjectByOrdinal for different tables, as the entire recordset will be reloaded
on each call. To load the first object in a table without loading
the entire table, use the <a href="DatabaseObjects_ObjectByOrdinalFirst.htm">ObjectByOrdinalFirst</a> function.</p>
<!-- InstanceEndEditable --><font face="Courier New, Courier, mono">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#f6f6f6"><pre><!-- InstanceBeginEditable name="example" --><span class="comment">
'<font face="Courier New, Courier, mono">Access the 1st product in the collection</font></span>
<span class="keyword">Set</span> objProduct = DBO.<font face="Courier New, Courier, mono">ObjectByOrdinal(objProducts, 1)
<span class="keyword">
</span><span class="comment">'Access the 10th product in the collection</span><span class="keyword">
</span><span class="comment">'This will not make another call to the database as all of the products will already be
'loaded into a temporary recordset from the call above
</span><span class="keyword">Set</span> objProduct = DBO.ObjectByOrdinal(objProducts, 10)
</font>
<!-- InstanceEndEditable --></pre></td>
</tr>
</table>
</font>
<p> </p>
<p align="center"><font size="1">� Hi Integrity Systems 2005. All rights reserved.</font></p>
</body>
<!-- InstanceEnd --></html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.