Transfer metadata from MySql to Delphi
Posted: Sat 26 Jul 2008 16:55
Im trying to get information about a MYSQL database to Delphi.
I use this code:
procedure TForm1.Button2Click(Sender: TObject);
var
s: string;
i : integer;
tl : tstringlist;
loop: integer;
Mymax : integer;
begin
tl:=tstringlist.Create;
qry_getinfo.SQL.Text:='describe organs.org';
qry_getinfo.open;
Mymax:=qry_getinfo.Fields.Count;
for loop := 0 to Mymax - 1 do
begin
tl.Add(qry_getinfo.Fields[loop].asstring);
end;
memo1.Text:= tl.Text;
tl.Free;
end;
I only get the first row of the information, but there should be about 18...
I use this code:
procedure TForm1.Button2Click(Sender: TObject);
var
s: string;
i : integer;
tl : tstringlist;
loop: integer;
Mymax : integer;
begin
tl:=tstringlist.Create;
qry_getinfo.SQL.Text:='describe organs.org';
qry_getinfo.open;
Mymax:=qry_getinfo.Fields.Count;
for loop := 0 to Mymax - 1 do
begin
tl.Add(qry_getinfo.Fields[loop].asstring);
end;
memo1.Text:= tl.Text;
tl.Free;
end;
I only get the first row of the information, but there should be about 18...