TrkItems.ReadDB (method)

ReadDB
Syntax: object.ReadDB bstrItemID
Parameters:
bstrItemID As String -
Tracker Item ID. This is optional parameter. CIMPLICITY wildcard characters "*" and "?" are allowed.
Description:
Reads items from the database and loads them into the TrkItems collection. If the parameter is not specified it will load all Items. If the parameter is not empty, it will load the item or items matching the search pattern. If matching item(s) do not exist in the database, then the collection will be empty.

Example 1:

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
   'Item is loaded from database.
Else
    'Item does not exist in database....
End If

Example 2:

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
'This will load all the items from the database
For Each oTrkItem In oTADBRoot.TrkItems
   MsgBox TrkItem.ID
Next

Example 3:

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 "A*"
'This will load all the items from the database that start with "A"
For Each oTrkItem In oTADBRoot.TrkItems
   MsgBox TrkItem.ID
Next