J
jugcx
Unregistered / Unconfirmed
GUEST, unregistred user!
for i:=0 to listbox2.Count-1 do
begin
listbox2.Selectall;
adoquery2.SQL.Clear;
adoquery2.SQL.add('select * from guanjz where guanj=' + '''' + listbox2.Items.Strings + '''');
adoquery2.Open;
LB3.Items.Add(adoquery2.FieldByName('daim').asString);
begin
e:=lb3.Items.Strings + ' AS ' + listbox2.Items.Strings;
begin
if listbox2.Count=i then
begin
d:= '';
end
else
begin
d:= ',';
listbox2.Items.Delete(i+1);
end;
end;
end;
f:=e + d + f;
showmessage(f);
adoquery2.Next;
end;
第二遍到 adoquery2.SQL.add('select * from guanjz where guanj=' + '''' + listbox2.Items.Strings + '''');
这行就出 Delphi list index out of bounds(1) Error问题,谢谢大家帮忙看看
begin
listbox2.Selectall;
adoquery2.SQL.Clear;
adoquery2.SQL.add('select * from guanjz where guanj=' + '''' + listbox2.Items.Strings + '''');
adoquery2.Open;
LB3.Items.Add(adoquery2.FieldByName('daim').asString);
begin
e:=lb3.Items.Strings + ' AS ' + listbox2.Items.Strings;
begin
if listbox2.Count=i then
begin
d:= '';
end
else
begin
d:= ',';
listbox2.Items.Delete(i+1);
end;
end;
end;
f:=e + d + f;
showmessage(f);
adoquery2.Next;
end;
第二遍到 adoquery2.SQL.add('select * from guanjz where guanj=' + '''' + listbox2.Items.Strings + '''');
这行就出 Delphi list index out of bounds(1) Error问题,谢谢大家帮忙看看