1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79:
| OpenDialog1.Execute;
titanconf := TiniFile.Create(OpenDialog1.FileName); host := titanconf.ReadString('DB','Host', ''); port := titanconf.ReadInteger('DB','port', port); user := titanconf.ReadString('DB','user', ''); password := titanconf.ReadString('DB','Password', ''); US := titanconf.ReadString('DB','UnixSocket', ''); DB := titanconf.ReadString('DB','db', ''); UNP := titanconf.ReadString('DB','UseNamedPipe', ''); USSL := titanconf.ReadString('DB','UseSSL', ''); compress := titanconf.ReadString('DB','Compress', ''); TS := titanconf.ReadString('DB','TrySockets', ''); titanconf.Free;
FMySQL := TMySQLClient.create;
FMysql.Host := host; FMysql.port := port; FMySql.user := user; FMysql.Password := Password; FMySQL.UnixSocket := US; FMysql.Db := db; IF UNP = 'ja' then begin FMysql.UseNamedPipe := true; end; IF UNP = 'nein' then begin FMysql.UseNamedPipe := false; end; IF USSL = 'ja' then begin FMysql.UseSSL := true; end; IF USSL = 'nein' then begin FMysql.UseSSL := false; end; IF compress ='ja' then begin FMysql.Compress := true; end; IF compress ='nein' then begin FMysql.Compress := false; end; IF ts = 'ja' then begin FMysql.TrySockets := true; end; IF ts = 'nein' then begin FMysql.TrySockets := false; end;
IF FMySql.Connect then begin
MessageDlg('Datenbankverbindung konnte aufgebaut werden.', mtInformation, [mbOk], 0); FMySQL.destroy; Label10.Caption := 'OK'; Form1.button1.Enabled := true; end else
MessageDlg('Fehler in der Datenbankverbindung ' + FMysql.LastError, mtError, [mbOk], 0);
procedure install; begin Form1.CABFile1.CABFile := 'data.cab'; Form1.CABFile1.TargetPath := 'C:Windowsmp2ico'; Form1.CABFile1.ExtractAll; end; |