function SQLConnect(_Object: TComponent; dbID: string; var _SQLConnection: TSQLConnection): boolean;
begin
_SQLConnection := TSQLConnection.Create(_Object);
with _SQLConnection do
begin
Name := 'SQLConnection' + dbID;
ConnectionName := 'MySQLConnection';
// hier evtl. andere Datenbanken prüfen oder über Ini-Datei gehen
DriverName := '
MySQL';
GetDriverFunc := 'getSQLDriverMYSQL';
LibraryName := 'dbexpmysql.dll';
LoadParamsOnConnect := False;
LoginPrompt := False;
KeepConnection := true;
params.Values['DriverName'] := '
MySQL';
params.Values['HostName'] := '
localhost';
params.Values['Database'] := 'db_name';
params.Values['User_Name'] := 'user';
params.Values['Password'] := 'pw';
params.Values['BlobSize'] := '-1';
params.Values['LocaleCode'] := '0000';
params.Values['Compress'] := 'True';
params.Values['Reconnect'] := 'True';
params.Values['LoginTimeout'] := '60';
params.Values['ReadTimeout'] := '15';
params.Values['WriteTimeout'] := '15';
VendorLib := 'libmysql.dll';
try
Connected := true;
except
on e:
Exception do Protokoll(DateTimeToStr(now)+' ' + e.Message,'service.log');
end;
end;
Result := _SQLConnection.Connected;
end;