Nicht getestet, aber so ungefähr:
Delphi-Quellcode:
procedure get_bookmarks(parent_id:integer;ebene:
string);
var
TempQuery: TZReadOnlyQuery;
begin
TempQuery := TZReadOnlyQuery.Create(
nil);
TempQuery.Connection := form1.zconnection1;
TempQuery.SQL.Text:='
SELECT * FROM bookmarks WHERE parent_id='+inttostr(parent_id);
TempQuery.Open;
TempQuery.FieldByName('
id').AsString;
while not TempQuery.Eof
do
begin
form1.listbox1.Items.Add(TempQuery.FieldByName('
url').AsString);
get_bookmarks(TempQuery.FieldByName('
id').AsInteger,'
- ');
TempQuery.Next;
end;
FreeAndNil(TempQuery);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
get_bookmarks(0,'
');
end;