public function Connection() {
      $this->_IsPersistent = GetValue(PDO::ATTR_PERSISTENT, $this->ConnectionOptions, FALSE);
      if(!is_object($this->_Connection)) {
         try {
            $this->_Connection = new PDO(strtolower($this->Engine) . ':' . $this->Dsn, $this->User, $this->Password, $this->ConnectionOptions);
            $this->_Connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
            
            if($this->ConnectionOptions[1002])
               $this->Query($this->ConnectionOptions[1002]);
            
            // We only throw exceptions during connect
            $this->_Connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
         } catch (Exception $ex) {
            $Timeout = FALSE;
            if ($ex->getCode() == '2002' && preg_match('/Operation timed out/i', $ex->getMessage()))
               $Timeout = TRUE;
            if ($ex->getCode() == '2003' && preg_match("/Can't connect to MySQL/i", $ex->getMessage()))
               $Timeout = TRUE;
                    
            if ($Timeout)
               throw new Exception(ErrorMessage('Timeout while connecting to the database', $this->ClassName, 'Connection', $ex->getMessage()), 504);
            
            trigger_error(ErrorMessage('An error occurred while attempting to connect to the database', $this->ClassName, 'Connection', $ex->getMessage()), E_USER_ERROR);
         }
      }
      
      return $this->_Connection;
   }