I am failing to connect to a MSSQL database on a remote machine using mssql_connect().
I can connect successfully when the application sits on the same box as the MSSQL database.
I can connect successfully to the database on the remote machine using odbc_connect() WITH A DSN.
Fails when connecting to the database on the remote machine using odbc_connect(), WITHOUT A DSN
APPLICATION SERVER
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
IIS 6.0
PHP 5.0.4
REMOTE DATABASE SERVER
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
Microsoft SQL Server 2005
Microsoft SQL Server Management Studio 9.00.3042.00
Any assistance greatly appreciated.
Dan
Code:
$db = mssql_connect (‘<remote db server name>’, ‘<username>’, ‘<password>’);
if (!$db)
{
echo “connection failure”;
}
else
{
echo “connection successful”;
mssql_close();
}
// returns “connection failure”
I can connect successfully when the application sits on the same box as the MSSQL database.
Code:
$db = mssql_connect (‘<local server name>’, ‘<username>’, ‘<password>’);
if (!$db)
{
echo “connection failure”;
}
else
{
echo “connection successful”;
mssql_close();
}
// returns “connection successful”
Code:
$db odbc_connect (‘<dsn to remote db server>’, ‘<username>’, ‘<password>’);
if (!$db)
{
echo “connection failure”;
}
else
{
echo “connection successful”;
odbc_close();
}
// returns “connection successful”
Code:
$db odbc_connect (‘<remote db server name >’, ‘<username>’, ‘<password>’);
if (!$db)
{
echo “connection failure”;
}
else
{
echo “connection successful”;
odbc_close();
}
// returns “connection failure”
APPLICATION SERVER
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
IIS 6.0
PHP 5.0.4
REMOTE DATABASE SERVER
Microsoft Windows Server 2003
Standard Edition
Service Pack 1
Microsoft SQL Server 2005
Microsoft SQL Server Management Studio 9.00.3042.00
Any assistance greatly appreciated.
Dan