unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBXpress,
DB, SqlExpr, StdCtrls, FMTBcd, Mask, DBCtrls;
type
TForm1 =
class(TForm)
Label1: TLabel;
Label2: TLabel;
SQLConnection1: TSQLConnection;
Button1: TButton;
DataSource1: TDataSource;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
Button2: TButton;
SQLDataSet1: TSQLDataSet;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
//SQLConnection1 = true
begin
// Die Datenmenge muss zum Ändern der SQL-Verbindung geschlossen werden
SQLConnection1.ConnectionName:='
MSConnection';
SQLConnection1.Params.Values['
BlobSize']:='
-1';
SQLConnection1.Params.Values['
Database']:='
Datenbankname';
SQLConnection1.Params.Values['
DriverName']:='
MYSQL';
SQLConnection1.Params.Values['
ErrorRessourceFile']:='
0000';
SQLConnection1.Params.Values['
HostName']:='
Servername';
SQLConnection1.Params.Values['
Password']:='
test';
SQLConnection1.Params.Values['
User_Name']:='
Tester';
SQLConnection1.ParamsLoaded:=true;
//Muß sein, damit die Daten eingetragen werden
SQLConnection1.Connected:=true;
SQLConnection1.Open;
end;
procedure TForm1.Button2Click(Sender: TObject);
//SQLDataSet1 = true
begin
//Button1.Click;
SQLDataset1.SQLConnection:=SQLConnection1;
SQLDataSet1.CommandText:='
SELECT * FROM adresse';
SQLDataset1.NoMetadata:=true;
end;
end.