Page 1 of 1

Connection could not be established.

Posted: Wed Apr 20, 2011 4:52 am
by zyntrax
Hi i am running an iis server with php and i got mssql extension, but i get an error when i try to connect to it with php:

Connection could not be established. Array ( [0] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [codé] => 18456 [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Inloggningen misslyckades f�r anv�ndaren FB\exalell. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Inloggningen misslyckades f�r anv�ndaren FB\exalell. ) [1] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [codé] => 18456 [2] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Inloggningen misslyckades f�r anv�ndaren FB\exalell. [message] => [Microsoft][SQL Server Native Client 10.0][SQL Server]Inloggningen misslyckades f�r anv�ndaren FB\exalell. ) )

It's complaing about the user but the user is dbowner.

This is the connection i use:

Code: Select all

$connectionInfo = array('Database'=>'fb_intra', 'UID'=>'FB\exalell', 'PWD'=>'pw'); 
$conn = sqlsrv_connect( "localhost\FB_INTRA", $connectionInfo);
if( $conn )
{
     echo "Connection established.\n";
}
else
{
     echo "Connection could not be established.\n";
     die( print_r( sqlsrv_errors(), true));
}	
I need help :(

Re: Connection could not be established.

Posted: Thu Apr 28, 2011 1:51 am
by prensil
try to use try...catch block like this:

Code: Select all

try{
      $conn = sqlsrv_connect( "localhost\FB_INTRA", $connectionInfo);
}catch(Exception $e){
    echo "<pre>";
    print_r($e);
    echo "</pre>";
    die;
}
May be the details description would help you.

Re: Connection could not be established.

Posted: Mon May 09, 2011 8:53 am
by zyntrax
Hi i tried, but it didn't catch anything.

Re: Connection could not be established.

Posted: Fri May 13, 2011 9:29 am
by John Cartwright
28000 generally means the user supplied credentials failed to authenticate.

Re: Connection could not be established.

Posted: Tue May 17, 2011 5:07 am
by zyntrax
Ok what can i do about it?

Re: Connection could not be established.

Posted: Tue Jun 21, 2011 9:35 am
by John Cartwright
zyntrax wrote:Ok what can i do about it?
You can get the correct authentication details from your host.