Saturday, February 25, 2012

Cannot connect to SQL2005 Express from PHP

Hello,
I have PHP 5.0.2 on Apache2/WinXP and database on MS SQL 2005 express.
I cannot connect to server:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to
server: TESTSERVER\SQLEXPRESS in C:\xxx\test.php on line 11
My source code test.php:
...
$connectstring = mssql_connect("TESTSERVER/SQLEXPRESS","sa","xx");
if ($connectstring == FALSE)
echo "ERROR!";
else
echo "OK!";
...
This example with MSDE2000 work ok, but with SQL2005 Express not. Help
me, please.
J.R.
I use new version ntwdblib.dll and all is OK!
http://support.microsoft.com/dllhelp...548&l=55&det=1
Jan Rok napsal(a):
> Hello,
> I have PHP 5.0.2 on Apache2/WinXP and database on MS SQL 2005 express.
> I cannot connect to server:
> Warning: mssql_connect() [function.mssql-connect]: Unable to connect to
> server: TESTSERVER\SQLEXPRESS in C:\xxx\test.php on line 11
> My source code test.php:
> ...
> $connectstring = mssql_connect("TESTSERVER/SQLEXPRESS","sa","xx");
> if ($connectstring == FALSE)
> echo "ERROR!";
> else
> echo "OK!";
> ...
> This example with MSDE2000 work ok, but with SQL2005 Express not. Help
> me, please.
> J.R.
|||What happens if you change TESTSERVER/SQLEXPRESS to TESTSERVER\SQLEXPRESS in
your connection string? Did you setup SQL Express for mixed mode access
when you installed it? By default it is Windows authentication only.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Jan Rok" <jan.rok@.email.cz> wrote in message
news:e2Z4SUXLGHA.420@.tk2msftngp13.phx.gbl...
> Hello,
> I have PHP 5.0.2 on Apache2/WinXP and database on MS SQL 2005 express.
> I cannot connect to server:
> Warning: mssql_connect() [function.mssql-connect]: Unable to connect to
> server: TESTSERVER\SQLEXPRESS in C:\xxx\test.php on line 11
> My source code test.php:
> ...
> $connectstring = mssql_connect("TESTSERVER/SQLEXPRESS","sa","xx");
> if ($connectstring == FALSE)
> echo "ERROR!";
> else
> echo "OK!";
> ...
> This example with MSDE2000 work ok, but with SQL2005 Express not. Help me,
> please.
> J.R.

No comments:

Post a Comment