unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, umysqlvio, uMysqlCT, uMysqlClient, uMysqlHelpers, StdCtrls;
{$I mysqlinc.inc}
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
FMysql: TMysqlClient;
FResult: TMysqlResult;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
FMysql := TMysqlClient.create;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FMysql.Free;
if FResult<>nil then
FResult.free;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
// Eigenschaften setzen
FMysql.Host := 'http://www.thecat.info';
FMysql.port := 3306;
FMysql.user :='web70';
FMysql.password := '*******'; // mein
SQL-PW
FMysql.UnixSocket := '';
FMysql.Db := 'usr_web70_29'; // Datenbank auf dem Server
FMysql.UseNamedPipe := false;
FMysql.UseSSL := false;
FMysql.Compress := true;
FMysql.TrySockets := false;
if FMysql.Connect then
ShowMessage('Verbindung aufgebaut')
else
ShowMessage('Fehler beim Verbinden: '+FMysql.LastError);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if FMysql.Connected then
FMysql.close
else
ShowMessage('Nicht verbunden!');
end;
end.