Click here to Skip to main content
15,881,757 members
Articles / Programming Languages / Visual Basic

Object-Oriented database design with the DatabaseObjects library

Rate me:
Please Sign up or sign in to vote.
4.00/5 (6 votes)
31 Jan 20076 min read 109.3K   3.9K   64  
Demonstrates creating object-oriented database systems with the DatabaseObjects library.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><!-- InstanceBegin template="/templates/interface.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 --><!-- InstanceParam name="remarks2" type="boolean" value="false" -->
<link href="default.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1>

<h1><!-- InstanceBeginEditable name="heading" -->IDatabaseObjects<!-- InstanceEndEditable --></h1>
<h3><!-- InstanceBeginEditable name="subheader" --> IDatabaseObjects_TableJoins(<span class="keyword">ByVal
      </span>objPrimaryTable<span class="keyword"> As </span>SQLSelectTable<span class="keyword">, </span><span class="keyword">ByVal</span> objTables <span class="keyword">As</span> SQLSelectTables) <span class="keyword">As</span> SQLSelectTableJoins<!-- InstanceEndEditable --><br>
</h3>
</h1>

<!-- InstanceBeginEditable name="text" -->
<p> This function should
  return an SQLSelectTableJoins object  containing the table or tables to be
  joined to the primary table. This function is useful in optimising database
  loading speeds by allowing multiple tables to be joined into one recordset.
  The resultant recordset can then be used to load
   objects from the associated tables avoiding subsequent
  SQL calls. For a complete example, see the 
  demonstration program. Implementing
  this function is optional.</p>
<!-- InstanceEndEditable -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#EAEBFF"><font size="-1">This interface function/property is
        utilised by the following functions:<br>
        <b><!-- InstanceBeginEditable name="utilisedby" -->
    Object, ObjectItem, ObjectByKey, ObjectByOrdinal, ObjectByOrdinalFirst, ObjectsSearch,
    ObjectsCollection<!-- InstanceEndEditable --></b></font></td>
  </tr>
</table><br>
<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">'J</font>oin the primary table to the Suppliers<font face="Courier New, Courier, mono"> </font>table, joining the primary table's SupplierID with the Supplier table's SupplierID.</span><span class="keyword"><font face="Courier New, Courier, mono">
</font>
Private Function</span> IDatabaseObjects_TableJoins(<span class="keyword">By<font face="Courier New, Courier, mono">Val</font></span><font face="Courier New, Courier, mono"> objPrimaryTable <span class="keyword">As</span> SQLSelectTable, </font><span class="keyword">ByVal</span> objTables <span class="keyword">As</span> SQLSelectTables) <span class="keyword">As</span> Dbo.SQLSelectTableJoins

    <span class="keyword">Dim</span> objTableJoins <span class="keyword">As</span> SQLSelectTableJoins
    <span class="keyword">Set</span> objTableJoins = <span class="keyword">New</span> SQLSelectTableJoins

    <span class="comment">'objPrimaryTable<font face="Courier New, Courier, mono"> is the table </font>specified <font face="Courier New, Courier, mono">in</font> the IDatabaseObjects_TableName function</span>
    <span class="keyword">With</span> objTableJoins.Add(objPrimaryTable, dboInnerJoin, objTables.Add(&quot;Suppliers&quot;))
        .Where.Add &quot;SupplierID&quot;, dboComparisonEqualTo, &quot;SupplierID&quot;
    <span class="keyword">End With</span>

    <span class="keyword">Set</span> IDatabaseObjects_TableJoins = objTableJoins

<span class="keyword">End Function</span>

<!-- InstanceEndEditable --></pre></td>
  </tr>
</table>
</font>
<p></p>
<!-- InstanceBeginEditable name="remarks" -->
<p>&nbsp;</p>
<!-- InstanceEndEditable -->

<p>&nbsp;</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.

License

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


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions