Database Objects
Hi-Integrity Systems
HomeVB6 Documentation › IDatabaseObjects.TableJoins

IDatabaseObjects

IDatabaseObjects_TableJoins(ByVal objPrimaryTable As SQLSelectTable, ByVal objTables As SQLSelectTables) As SQLSelectTableJoins

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.

'Join the primary table to the Suppliers table, joining the primary table's SupplierID 'with the Supplier table's SupplierID. Private Function IDatabaseObjects_TableJoins( _ ByVal objPrimaryTable As SQLSelectTable, _ ByVal objTables As SQLSelectTables) As Dbo.SQLSelectTableJoins Dim objTableJoins As SQLSelectTableJoins Set objTableJoins = New SQLSelectTableJoins 'objPrimaryTable is the table specified in the IDatabaseObjects_TableName function With objTableJoins.Add(objPrimaryTable, dboInnerJoin, objTables.Add("Suppliers")) .Where.Add "SupplierID", dboComparisonEqualTo, "SupplierID" End With Set IDatabaseObjects_TableJoins = objTableJoins End Function

This interface function/property is utilised by the following functions:
Object, ObjectItem, ObjectByKey, ObjectByOrdinal, ObjectByOrdinalFirst, ObjectsSearch, ObjectsCollection