Follow the code:
var
i : integer;
begin
i := 0;
DataModule1.ZConnection1.Database := edtDB.Text;
DataModule1.ZConnection1.HostName := edtLocal.Text;
DataModule1.ZConnection1.User := 'root';
DataModule1.ZQuery1.Close;
DataModule1.ZQuery1.SQL.Clear;
DataModule1.ZQuery1.SQL.Add('SHOW TABLES FROM '+edtDB.Text);
DataModule1.ZQuery1.Open;
while not DataModule1.ZQuery1.Eof do
begin
inc(i);
DataModule1.ZQuery2.Close;
DataModule1.ZQuery2.SQL.Clear;
DataModule1.ZQuery2.SQL.Add('CHECK TABLE ' + edtDB.Text + '.' +
DataModule1.ZQuery1.FieldByName('Tables_in_' + edtDB.Text).asString);
DataModule1.ZQuery2.ExecSQL;
DataModule1.ZQuery1.Next;
end;
What I want is that by the end of the lines found in showTables
(which is situated in the first dbgrid), my check reads all lines (with tables) and consequently give a check
in another dbgrid, how do I do this?
Updated Code