unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,
DB, ZTransact, ZMySqlTr, ZQuery, ZMySqlQuery, ZConnect,
ZMySqlCon, StdCtrls, ComCtrls, Grids, Menus, ExtCtrls;
type
TDumperMain =
class(TForm)
Database: TZZMySqlDatabase;
Query: TZZMySqlQuery;
Transact: TZZMySqlTransact;
DataSource: TDataSource;
EditServer: TEdit;
EditBenutzer: TEdit;
EditPasswort: TEdit;
EditDatenbank: TEdit;
ButtonConnect: TButton;
StatusBar: TStatusBar;
StringGrid: TStringGrid;
procedure ButtonConnectClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
DumperMain: TDumperMain;
implementation
{$R *.dfm}
procedure TDumperMain.ButtonConnectClick(Sender: TObject);
var
col : Integer;
begin
col := 0;
Database.Host := EditServer.Text;
Database.Login := EditBenutzer.Text;
Database.Password := EditPasswort.Text;
Database.Database := EditDatenbank.Text;
try
Database.Connected := True;
except
StatusBar.SimpleText := '
Verbindung konnte nicht hergestellt werden';
end;
try
StatusBar.SimpleText := '
Verbindung aufgebaut';
Query.Sql.Text := '
SHOW TABLES';
Query.Open;
while not Query.Eof
do
begin
StringGrid.Cells[col,0] :=
Query.Fields[col].AsString;
col:=col+1;
Query.Next;
end;
finally
Database.Connected := False;
StatusBar.SimpleText := '
Verbindung geschlossen';
end;
end;
end.