Different versions of SQL Native Client in SQL Server 2008 R2

sql-server-2008-r2windows-server-2008

I have this error when I try to connect from a Server called: AplicationServer1 to another server in the same domain Kobl, called DatabaseServer1

SQLSTATE[28000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Login failed for user 'KOBL\kobladmin'.

The first strange thing is in DatabaseServer1 has Sql Server 2008 R2 with Sql Native Client 10.0 and I dont know why appear 11.0 versiĆ³n in the above line when I try to connect to DatabaseServer in browser.

I'm using on side AplicationServer1:

  • PHP 5.4
  • IIS 7

DatabaseServer1:

  • Sql Server 2008 R2

I'm use that code to make connection:

config.php

<?php
define ("DB_USER","KOBL\kobladmin");
define ("DB_PASS","AdminKobl");
define ("DSN","sqlsrv:server=databasebserver1.kobl.com;database=kobl_system");
?>

connect.php

<?php
require 'config.php';

class DB_Connect {

private static $_instance;

//Connecting to database
public function &pdo_connect() {
    if(!self::$_instance) {
        try{
            self::$_instance = new PDO(DSN,DB_USER, DB_PASS);
            self::$_instance->setAttribute(PDO::ATTR_PERSISTENT, true);
            self::$_instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        } catch (PDOException $ex) {
            die("PDO Connection error: ".$ex->getMessage()."<br/>");
        }
    }
    return self::$_instance;
}

private function __construct() {
}

private function __clone() {
}
}
?>

Credential to connect Sql Server is the same that Windows Authentication.

Note: Names of domain, user and password are fake (I put that because sometimes say me "You couldn't put real data of your database connection".

Best Answer

SQL Native Client 11 appears in the error because that's the version of the client that ApplicationServer1 is using to connect to DatabaseServer1. SQL 2012 client tools must have been installed on the app server.

The authentication issue seems to be that KOBL\kobladmin is does not have the permissions to your database. Make sure you have 1) created a Windows login for that account in SQL Server and then 2) granted that login the appropriate permissions within the kobl_system database.

Related Topic