ITrkTable Interface | |
Description: | A TrkTable object contains Tracker attribute data. Each TrkTable is either a "Normal" Table or a "List" Table. A Normal table has set of attributes associated with a unique Item ID. A record in this table is uniquely identified by an Item ID. A List table has a set of attributes associated with an Item ID. A record in this table is uniquely identified by one or more attributes along with an Item ID. The unique key is often a composite key. A table can have a lookup table for higher level of normalization. If the HasALookup property of this object is True, then this table has a lookup (master) table. To access records in a table, first call the ReadDB method, and then traverse through the TrkRecords collection object to access individual records of the table. Each table has an Item ID as record field. To add a new record, provide the Item ID. Example: Dim oTADBRoot As Object Dim oTrkTable As Object Dim oTrkRecord As Object Dim oTrkField As Object Set oTADBRoot = CreateObject("TADB.TADBRoot") If oTADBRoot Is Nothing Then MsgBox "Root Object is not
created" End If oTADBRoot.Load "TRK7", "" Set oTrkTable = oTADBRoot.FindTable("VEHICLE ORDER",
"PARTS") If Not oTrkTable Is Nothing Then 'TrkTable Found ... If oTrkTable.HasALookup
Then If MsgBox ("Do you
want lookup table data?", 4) <> 6 Then 'If not Press
'Yes' oTrkTable.WantLookup
= False End If End If 'now read data from
database.... oTrkTable.ReadDB "Item3" For Each oTrkRecord In
oTrkTable.TrkRecords MsgBox "Record ID:
" & oTrkRecord.ID For idx = 1 To
oTrkRecord.TrkFields.Count Set
oTrkField = oTrkRecord.TrkFields.Item(idx) If
Not oTrkField Is Nothing Then MsgBox
"Field Name: " & oTrkField.Name & "Field Value:" &
oTrkField.Value End
If Next Next Else 'Table Not found End If |
Properties: | HasALookup , IsLookup , Name , TrkItemTypeGroupAttribs , TrkRecords , WantLookup |
Methods: | ApplyUpdate , ReadDB , RemoveAll |