<?php 
  include_once('adodb5/adodb.inc.php'); 
  include_once('funciones.php');
  if (strlen(session_id()) < 1) session_start();
  //session_start();
  include_once('setConf.php');

  $server = desencriptar($_SESSION['curr003Server']);
  $db     = desencriptar($_SESSION['curr003Base']); 
  $user   = desencriptar($_SESSION['curr003UsrDB']);
  $pwd    = desencriptar($_SESSION['curr003PasDB']);

  $DBSegu = NewADOConnection('mssqlnative');


  if (!$DBSegu->Connect($server, $user, $pwd, $db)) {
    echo "Seguridad - Error al conectar con el servidor";
  } 
  else {
    $DBSegu->SetFetchMode(ADODB_FETCH_ASSOC);
  }

  $connectionInfo = array( "Database"=>$db, "UID"=>$user, "PWD"=>$pwd);
  $conn = sqlsrv_connect( $server, $connectionInfo);  

  if( !$conn ) {
    echo "Conexión no se pudo establecer.<br />";
    die( print_r( sqlsrv_errors(), true));
  }
?>

