<!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" -->ObjectByKey(<span class="keyword">ByVal</span> objCollection
<span class="keyword">As</span> IDatabaseObjects, <span class="keyword">ByVal</span> vKey <span class="keyword">As
Variant</span>) <span class="keyword">As</span> IDatabaseObject<!-- InstanceEndEditable --><br>
</h3>
</h1>
<!-- InstanceBeginEditable name="text" -->
<p>ObjectByKey returns an object from the collection using a unique key value.
The key must be unique within the collection. If the collection's <a href="IDatabaseObjects_Subset.htm">IDatabaseObjects_Subset</a> has
been implemented then the key need only be unique within the subset not the
entire table. vKey is the value for the field defined by
the collection's <a href="IDatabaseObjects_KeyFieldName.htm">IDatabaseObjects_KeyFieldName</a>.</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="keyword"><font face="Courier New, Courier, mono">
</font></span><font face="Courier New, Courier, mono"><span class="keyword">Dim</span> objProduct <span class="keyword">As</span> Product</font>
<span class="comment">'Assume that the objGlobalProductsInstance<font face="Courier New, Courier, mono">'s </font>IDatabaseObjects_KeyFieldName has been set<font face="Courier New, Courier, mono"> to ProductCode</font></span><font face="Courier New, Courier, mono">
<span class="comment">'</span></font><span class="comment">Return the product with a product code of "PC12345"</span>
<span class="keyword">Set</span> objProduct = DBO<font face="Courier New, Courier, mono">.ObjectByKey(objGlobalProductsInstance<span class="keyword"></span>, "PC12345")</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>