with qry
do
Begin
IB_Connection := frmcoDMC.co_Admin;
SQL.Text := '
SELECT ABL_ALLGEMEIN.ID0_0,ABL_ALLGEMEIN.ID0_1,ABL_ALLGEMEIN.DOKUID0, ABL_ALLGEMEIN.DOKUID1, '+
'
ABL_ALLGEMEIN.TYP, ABL_ALLGEMEIN.BESCHREIBUNG, ABL_ALLGEMEIN.WERT, ABL_ALLGEMEIN.OBJEKTTEXT '+
'
FROM ABL_ALLGEMEIN '+
'
WHERE ((ABL_ALLGEMEIN.DOKUID0 = :P_1) and (ABL_ALLGEMEIN.DOKUID1 = :P_2)) ';
ParamByName('
P_1').AsString := V_ID0;
ParamByName('
P_2').AsString := V_ID1;
Open;
while not eof = True
do
Begin
li := Listview1.Items.Add;
//Beschreibung
li.caption := fields[7].AsString;
//ID0
li.SubItems.Add(fields[0].AsString);
//ID1
li.SubItems.Add(fields[1].AsString);
//Tabelle
li.SubItems.Add(fields[2].AsString);
//DokuId0
li.SubItems.Add(fields[3].AsString);
//DokuId1
LI.SubItems.Add(fields[4].AsString);
LI.SubItems.Add(fields[5].AsString);
LI.SubItems.Add(fields[6].AsString);
ZeroMemory(@fi,sizeof(fi));
SHGetFileInfo(pchar(fields[7].AsString),0,fi,sizeof(fi),
SHGFI_ICON
or SHGFI_SYSICONINDEX
or SHGFI_TYPENAME);
li.ImageIndex := fi.iIcon;
listviewpanel.Visible := true;
Next;
end;
Close;
Free;
end;