diff --git a/Source/Servidor/uDataModuleServer.pas b/Source/Servidor/uDataModuleServer.pas index 153d3ed..595ea47 100644 --- a/Source/Servidor/uDataModuleServer.pas +++ b/Source/Servidor/uDataModuleServer.pas @@ -38,9 +38,10 @@ type private FEscribirLog : TCriticalSection; FConnectionName : string; - function GetConnectionString: string; + //function GetConnectionString: string; procedure IniciarLog; - procedure DetenerLog; + procedure DetenerLog; + procedure CrearConexiones; public FDBServer : string; FDBPort : string; @@ -160,6 +161,33 @@ begin Connection.RollbackTransaction; end; +procedure TdmServer.CrearConexiones; +var + AConn : String; +begin + //IBX + AConn := 'IBX?Server=' + FDBServer + '/' + FDBPort + + ';Database=' + FDBPath + + ';UserID=' + FDBUser + + ';Password=' + Decrypt(FDBPass) + + ';Dialect=3;Charset=ISO8859_1;'; + ConnectionManager.Connections.ConnectionByName('IBX').ConnectionString := AConn; + + //MSSQL + //ADO?AuxDriver=SQLOLEDB.1;Server=ROB_VM_FARMACIA\FARMATIC;Database=farmatic;UserID=rodax;Password=rodax; + //ADO?AuxDriver=SQLOLEDB.1;Server=ROB_VM_FARMACIA\FARMATIC;Database=farmatic;Integrated Security=SSPI + + AConn := 'ADO?AuxDriver=SQLOLEDB.1;Server=' + FMSSQLServer + + ';Database=' + FMSSQLPath; + + if FMSSQLIntSecurity = 1 then + AConn := AConn + ';Integrated Security=SSPI' + else + AConn := AConn + ';UserID=' + FMSSQLUser + + ';Password=' + Decrypt(FMSSQLPass); + ConnectionManager.Connections.ConnectionByName('FARMATIC').ConnectionString := AConn; +end; + function TdmServer.DarNuevaConexion: IDAConnection; begin with ConnectionManager do @@ -186,7 +214,7 @@ begin IniciarLog; end; -function TdmServer.GetConnectionString: string; +{function TdmServer.GetConnectionString: string; begin Result := 'IBX?Server=' + FDBServer + '/' + FDBPort + ';Database=' + FDBPath @@ -194,12 +222,7 @@ begin + ';Password=' + Decrypt(FDBPass) + ';Dialect=3;Charset=ISO8859_1;'; -{ Result := 'FIB?Server=' + FDBServer + '/' + FDBPort - + ';Database=' + FDBPath - + ';UserID=' + FDBUser - + ';Password=' + Decrypt(FDBPass) - + ';Dialect=3;Charset=ISO8859_1;';} -end; +end;} procedure TdmServer.LeerConfiguracion; begin @@ -294,10 +317,10 @@ end; procedure TdmServer.RefrescarConexion; begin HTTPServer.Active := False; - ConnectionManager.Connections.GetDefaultConnection.ConnectionString := ''; + + CrearConexiones; ConnectionName := ConnectionManager.GetDefaultConnectionName; - ConnectionManager.Connections.GetDefaultConnection.ConnectionString := GetConnectionString; if not ROIsService then ShowBalloonHint('Conectado a ' + ConnectionName, bfInfo);