I stepped through the table initialization and isolated the problem to the MasterFields by changing to a field without a space in the name which allowed the table to open without the error. I also tried commenting out the SmartFetch.Enabled = True statement when the MasterFields property used the name with spaces and the table also opened without errors. My final workaround attempt was to replace the "Test Set ID"' quotes with [Test Set ID] brackets like the TLiteTable default SQL statements but the same error was generated.
My initial testing of SmartFetch with LiveBlock resulted in a huge reduction in the amount of memory used for opening a large archive table and will solve several problems using our large databases. Any suggestions about how to make this work or did I discover a TLiteTable bug?
Original IndexFieldNames Table Setup:
Code: Select all
With TestListLiteTable do
begin
Close;
Connection := WC6SourceLite;
TableName := 'CSetList';
Options.StrictUpdate := False;
Options.QuoteNames := True;
Options.QueryRecCount := True;
stKey := '"Test Set ID"; EquipmentID';
IndexFieldNames := stKey;
DetailFields := '"Test Set ID"';
MasterFields := '"Test Set ID"';
MasterSource := TestSetDS;
Open;
end;
Code: Select all
With TestListLiteTable do
begin
Close;
Connection := WC6SourceLite;
TableName := 'CSetList';
Options.StrictUpdate := False;
Options.QuoteNames := True;
Options.QueryRecCount := True;
stKey := '"Test Set ID"; EquipmentID';
KeyFields := stKey;
SmartFetch.PreFetchedFields := stKey;
SmartFetch.Enabled := True; <<<--- Comment out and table opens without error!
stOrd := '"Test Set ID", EquipmentID';
OrderFields := stOrd;
DetailFields := '"Test Set ID"';
MasterFields := '"Test Set ID"';
MasterSource := TestSetDS;
Open;
end;