Advertisement
Advertisement
| 07.10.2008 at 06:48AM PDT, ID: 23553687 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: |
Form1: here I get the run time error
procedure TLibraryDefinitionsForm.AutoInsert(aRecord : TStringList);
var i : Integer;
begin
for i:= 0 to aRecord.Count-1 do
begin
LibViewStatusBar.SimpleText := aRecord[i];
end;
end;
From2 : here I create the data ....
procedure TLoadExcelLibForm.ImportDataSetButtonClick(Sender: TObject);
var i,j : Integer;
aRecord : TStringList;
begin
//
aRecord :=TStringList.Create;
ADOQuery.First;
repeat
//
aRecord.Clear;
// loop through all fields
//
for j:= 0 to ADOFieldNamesListBox.Count-1 do
if ADOFieldNamesListBox.Selected[j] then
begin
// show the field
MyStatusBar.SimpleText := ADOQuery.FieldByName(ADOFieldNamesListBox.Items[j]).asString;
aRecord.Add(MyStatusBar.SimpleText);
aRecord.Add('******');
aRecord.Add('xxxxxxx');
end;
// just for debugging, aRecord has the correct data inside ...
//
for i:= 0 to aRecord.Count-1 do
begin
MyStatusBar.SimpleText := aRecord[i];
end;
// call the function inside the other module ->
// where is the bug ??????????
LibraryDefinitionsForm.AutoInsert(aRecord);
ADOQuery.Next;
until ADOQuery.Eof;
//
aRecord.Free;
end;
end.
|