procedure TMySQLDB.Connect (Connection: TUniConnection);
var Datei: TextFile;
MyString:
String;
ResultDBZugriff: integer;
begin
ResultDBZugriff:=0;
if not FileExists(ExtractFilePath(Application.ExeName) + '
SQL.set')
then begin
ResultDBZugriff:=Form_DBZugriffsdaten.ShowModal;
//Hier tritt der Fehler auf!
if ResultDBZugriff>1
then begin
Exit;
end;
end;
AssignFile(Datei, ExtractFilePath(Application.ExeName) + '
SQL.set');
Reset(Datei);
try
ReadLn(Datei, MyString);
Connection.Server := copy(MyString, pos('
:', MyString)+1, length(MyString));
ReadLn(Datei, MyString);
Connection.Username := copy(MyString, pos('
:', MyString)+1, length(MyString));
ReadLn(Datei, MyString);
Connection.Password := copy(MyString, pos('
:', MyString)+1, length(MyString));
ReadLn(Datei, MyString);
Connection.Database := copy(MyString, pos('
:', MyString)+1, length(MyString));
ReadLn(Datei, MyString);
Connection.ProviderName := copy(MyString, pos('
:', MyString)+1, length(MyString));
ReadLn(Datei, MyString);
Connection.Port := strtoint(copy(MyString, pos('
:', MyString)+1, length(MyString)));
finally
CloseFile(Datei);
end;
Connection.Connected:=true;
end;