ich komme selber eher aus dem bereich Java, spiele mommentan was mit FP rum, da habe ich mir ein paar Programme zusammengefrickelt(Als was anderes kann man das noch nich bezeichnen, aber wir lernen ja noch

Code: Alles auswählen
unit SQL_;
interface
uses
Classes, SysUtils, mysql50conn, mysql51conn, sqldb;
type
MySQLConnection1=TMySQL50Connection;
SQLQuery1=TSQLQuery;
SQLTransaction1=TSQLTransaction;
procedure Ausgelagert_1;
implementation
procedure Ausgelagert_1;
begin
try
if MySQLConnection1.Connected then MySQLConnection1.Close;
MySQLConnection1.HostName:='192.168.178.45';
MySQLConnection1.UserName:='...';
MySQLConnection1.Password:='....';
MySQLConnection1.DataBaseName:='...';
if MySQLConnection1.Connected then MySQLConnection1.Connected := false;
MySQLConnection1.Connected := true;
MySQLConnection1.Open;
if MySQLConnection1.Connected then
begin
SQLQuery1.SQL.Text:='SELECT ...;';
SQLQuery1.Open;
while not SQLQuery1.EOF do
begin
SQLQuery1.Next;
end;
SQLQuery1.Close;
end;
except
// GEHT NICH
end;
end;
end.