GlobalDatabase
GlobalObject(ByVal objGlobalCollection As IGlobalDatabaseObjects, ByVal vDistinctValue As Variant) As IDatabaseObject
Returns an object from a global collection - a class that has implemented the IGlobalDatabaseObjects interface. This function is purely for convenience as it avoids having to cast to an IGlobalDatabaseObjects interface and then call the Object function. For this reason, the function and class are not included in the .NET version as the DirectCast function can be used for this purpose (see example below). For further details see IGlobalDatabaseObjects.
'In a class outside of the InventoryDB DLL
Dim objProduct As Product
'Return a Product object that has an ID of 12345
'This helps maintain the class abstraction layer by avoiding
'public functions and properties that expose database ID values in the InventoryDB library
'See the Product class in the demonstration project as to how the IGlobalDatabaseObjects
'interface has been implemented
Set objProduct = DBO.GlobalObject(InventoryDB.Products, 12345)
'.NET equivalent method
Dim objProduct As Product = _
DirectCast(NorthwindDB.Products, IGlobalDatabaseObjects).Object(12345)