Forum Moderators: coopster
The company has just updated php with added mssql support and I can connect to the mssql databse using SQL Server Management Studio (So I dont think the problem lies on the databse side).
I am trying
<?php
$DBServer = ipaddress:port;
$DBUsername = dbusername;
$DBPass = dbpass;
$dbhandle = mssql_connect($DBServer, $DBUsername, $DBPass) or die ("Couldn't connect to SQL Server);
?>
And it keeps giving me the "Couldn't connect..." message and I dont know what to do.
I am afraid the guys did not get mssql installed properlly on their side as they said their knowledge on php was limited.
Anybody can help me up? Anybody has gotten this working?
Is there a way to get some sort of error message back from the SQL server to pinpoint the problem?
Best Regards
NooK
I've dealt with this issue an annoying number of times. Generally, the issue is with the newer versions of PHP--the ntwdblib.dll file distributed with PHP is apparently the wrong version, and must be replaced in order to successfully connect with Microsoft SQL. Do a Google search on ntwdblib.dll and you'll come up with something. :)
In addition, if you're attempting to connect to SQL Express 2005, you'll need to specify the instance name--generally "MachineName\SQLEXPRESS"--as the connection address.
[edited by: WesleyC at 4:20 pm (utc) on Aug. 17, 2007]
I unfortunatelly had to use ADODB to connect to the server but I am having a problem where if the query is unsuccessfull (Due for example to missing data such as trying to query a table that doesnt exist or create a databse without the permission to do so) it simply shows me no error at all and halts the webpage parsing.
Could you please take a look here
[webmasterworld.com...]
for a better explanation and hopefully someone has a some solution.
Best Regards
NooK
[edited by: NooK at 12:54 pm (utc) on Aug. 27, 2007]