unit hauptformular;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ToolWin, Menus, XPMan, Buttons, ExtCtrls, umysqlvio,
uMysqlCT, uMysqlClient, uMysqlHelpers;
{$I mysqlinc.inc}
type
Ths_kis =
class(TForm)
MainMenu1: TMainMenu;
Datei1: TMenuItem;
Beenden1: TMenuItem;
ToolBar1: TToolBar;
StatusBar1: TStatusBar;
XPManifest1: TXPManifest;
SpeedButton1: TSpeedButton;
Timer1: TTimer;
Timer2: TTimer;
procedure Timer2Timer(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure Beenden1Click(Sender: TObject);
private
public
FMysql: TMysqlClient;
FResult: TMysqlResult;
end;
var
hs_kis: Ths_kis;
implementation
uses kunden_suche_form, login_form_form;
{$R *.dfm}
procedure Ths_kis.Beenden1Click(Sender: TObject);
begin
hs_kis.Close;
end;
procedure Ths_kis.FormResize(Sender: TObject);
begin
StatusBar1.Panels[0].Width := hs_kis.Width - 140;
end;
procedure Ths_kis.Timer1Timer(Sender: TObject);
begin
StatusBar1.Panels[1].Text := '
'+DateTimeToStr(Now);
end;
procedure Ths_kis.SpeedButton1Click(Sender: TObject);
begin
Tkunden_suche.Create(Self);
end;
procedure Ths_kis.FormShow(Sender: TObject);
begin
// Eigenschaften setzen
FMysql.Host := '
xxx.de';
FMysql.port := 3306;
//FMysql.user :='xxx';
//FMysql.password := 'xxx';
FMysql.UnixSocket := '
';
FMysql.Db := '
xxx';
// Datenbank auf dem Server
FMysql.UseNamedPipe := false;
FMysql.UseSSL := false;
FMysql.Compress := true;
FMysql.TrySockets := false;
if FMysql.Connect
then
begin
StatusBar1.Panels[0].Text := '
Status: Verbindung zum Datenbakserver aufgebaut';
Tkunden_suche.Create(Self);
end
else
begin
//StatusBar1.Panels[0].Text := 'Fehler beim Verbinden: '+FMysql.LastError;
//SpeedButton1.Enabled := false;
end;
end;
procedure Ths_kis.FormCreate(Sender: TObject);
begin
FMysql := TMysqlClient.create;
end;
procedure Ths_kis.FormDestroy(Sender: TObject);
begin
FMysql.Free;
if FResult<>
nil then
FResult.free;
end;
procedure Ths_kis.Timer2Timer(Sender: TObject);
begin
case login_form.login_count
of
0: ;
1: ;
2: ;
3: ;
else hs_kis.Close;
end;
end;
end.