Reputation: 117
I'm trying two methods to connect to my Microsoft SQL Server. We host our own website and have Microsoft SQL Server 2008 installed.
I've tried connecting using the server names of localhost, dsw-server, and our public IP address, all throw the same error.
You can test the connection here http://dswdist.com/db_connect.php to see the code and errors.
If the php_info helps, here is my info http://dswdist.com/phpinfo.php
Not sure what other information I can provide, but let me know what you need from me to help. Thanks! :)
Upvotes: 0
Views: 1366
Reputation: 27884
Make sure your server name is correct.
MyServerName
OR
MyServerName\MyInstanceName
Make sure the IDENTITY running your PHP code has rights to login to the server, and has rights to the database. The IDENTITY running your PHP code is probably not "you".
Here is an idea that bypasses the "code".
A. Open Control Panel / Admin Tools / Data Sources (ODBC) B. Find System DSN tab. C. Add a new (you can delete later) System DSN, and put in your servername and credentials.
( # 3 will not address the PHP/IDENTITY issue, but will make sure you have a valid server/instance/database name. )
Upvotes: 1