Database Objects
Hi-Integrity Systems
HomeVB6 Documentation › DBO.ObjectFromFieldValues


ObjectFromFieldValues(ByVal objCollection As IDatabaseObjects, ByVal objFieldValues As SQLFieldValues)

ObjectFromFieldValues returns an object using values from an SQLFieldValues object. This function is only really useful when attempting to load another object from within an IDatabaseObject_Load function which only occurs when the IDatabaseObjects_TableJoins function has been implemented.

'Product class Private Sub IDatabaseObject_Load(ByVal objFields As DBO.SQLFieldValues) 'Load regular fields as normal pstrName = objFields("ProductName") pcurUnitPrice = objFields("UnitPrice") ... 'Check if a field from the adjoining table exists, if it does then we can 'use the associated fields If objFields.Exists("CompanyName") Then 'Load the supplier object from objFields because it will contain all of the associated 'supplier fields due to IDatabaseObjects_TableJoins being implemented Set pobjSupplier = DBO.ObjectFromFieldValues(Data.Suppliers, objFields) End If End Sub