From 933db1660dec0e101a970b386866df2b355963cc Mon Sep 17 00:00:00 2001 From: roberto Date: Mon, 12 Dec 2011 16:30:35 +0000 Subject: [PATCH] =?UTF-8?q?-=20Conexi=C3=B3n=20a=20MS=20SQL=20Server=20gua?= =?UTF-8?q?rdada=20en=20configuraci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.FarmaciaPH_Etiquetas/trunk@25 7b0b1a58-4aa1-b946-8089-8453ede31e50 --- Source/Servidor/uDataModuleServer.pas | 45 ++++++++++++++++++++------- 1 file changed, 34 insertions(+), 11 deletions(-) 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);