views:

119

answers:

1

Hi,

I'm currently using vs.php on a development client. (vs.php is a php dev IDE that uses the visual studio shell).

The problem is connecting to our remote sql 2005 database. The connectionattempt fails in less than 1 seconds. I can connect to the database with telnet without problem from the same client.

The database is set to allow remote connections.

$srv = "xxx.xxx.xxx.xxx, xxxx";
$ci = array();
$ci["UID"] = "xxxxx_user";
$ci["PWD"] = "xxxxx";
$ci["DATABASE"] = "xxxx";
$conn = sqlsrv_connect($srv, $ci) OR DIE("no connection");

The debugger for some reason won't throw any error messages as to why the connection fails.

I just can't seem to find a solution to why it instantly drops my connection, are there any settings in the builtin vs.php webserver, or anything hardcoded in vs.php itself? Or has it anything to do with vs.php's php configuration? Are there any apache or php settings in general that could be the cause of this? Or maybe something with the database afterall? I looked through it but couldn't find anything.

I wish I could supply more info, but I'm clueless as to why it fails.

Any help would be greatly appreciated

Jonas

A: 

Have you tried adjusting the case of the 'DATABASE' key in the connection options array? The documentation suggests that this should be 'Database' - might be worth a shot....

$srv = "xxx.xxx.xxx.xxx, xxxx";
$ci = array();
$ci["UID"] = "xxxxx_user";
$ci["PWD"] = "xxxxx";
$ci["Database"] = "xxxx";
$conn = sqlsrv_connect($srv, $ci) OR DIE("no connection");
Paul Dixon
Hi thanks for reply.Yes that is correct, I've actually tried all lowercase / all uppercase and first letter capital as database key. Also tried the other keys as lowercase to with no success.I appreciate your answer though, it's a valid point.
Jonas B
Not sure what else to suggest aside from checking the server logs...
Paul Dixon
Yeah it seems the connection is rejected locally. But it does not matter anymore we setup a IIS with php/fastCGI and use a remote project instead. Thanks for your effort in trying to help!
Jonas B