TrkItems (object)

ITrkItems Interface
TrkItems is collection object holding TrkItem objects. To build the collection, create a TrkItems object and call its ReadDB method. The ReadDB method reads the items from the database and stores each of the items returned in a TrkItem object.


Dim oTADBRoot As Object
Dim oTrkItem As Object

Set oTADBRoot = CreateObject("TADB.TADBRoot")

If oTADBRoot Is Nothing Then
   MsgBox "Root Object is not created"
End If

oTADBRoot.Load "TRK7", ""

oTADBRoot.TrkItems.ReadDB "AnyItemID"
If oTADBRoot.TrkItems.Count=1 Then
'Modify Item. Item Already present.
     oTrkItem.ReferenceID ="ItemRefIDYY"
     oTrkItem.ItemTypeID = "Body Component"
     oTrkItem.Save 'Call Save method...
Set oTrkItem = oTADBRoot.TrkItems.Add("AnyItemID")
     If Not oTrkItem Is Nothing Then 'If oTrkItem is valid
         oTrkItem.ReferenceID = "ItemRefID"
         oTrkItem.ItemTypeID = "ItemTypeID"
         oTrkItem.Save 'Add the item to the database.
         MsgBox "Error adding item in items collection.".
     End If
End If

Properties: Count
Methods: Add , Item , ReadDB , Remove