Results 1 to 1 of 1
I recently transitioned from one Linux server to another. Most everything I've been able to successfully recreate in the new environment. However, I've been struggling with getting PHP to harness ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-19-2009 #1
- Join Date
- Jan 2009
FreeTDS - Can connect via tsql query tool, but not PHP
I recently transitioned from one Linux server to another. Most everything I've been able to successfully recreate in the new environment. However, I've been struggling with getting PHP to harness tsql and get it talking to my MS SQL Server 2000 machine. It didn't take too long to get the tsql command prompt to connect to the machine, which correctly accepts my password, so I am fairly confident that odbc and FreeTDS are jiving together nicely.
When I try to access the server through PHP though, I have problems. I know that it is successfully reading my odbc.ini file because when I modify the name of the data source, it gives me an error related to not finding the data source name. But when the data source name is found, I get the following error instead:
Warning: odbc_connect() [function.odbc-connect]: SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect in /path/to/filename.php on line 6
[unixODBC][FreeTDS][SQL Server]Unable to connect to data source
I've posted the two relevant chunks of text that seem pertinent. Anybody have any ideas on what could be causing this, or is there any other relevant information I ought to post? Any help is super-appreciated.
Driver = FreeTDS
Description = Acme Data Warehouse
Trace = No
Server = 220.127.116.11
Port = 1433
Database = Database_name
Connection string in PHP:
// ODBC conneciton to MS SQL
$MSSQL_SERVER = odbc_connect($mssql_dsn, $mssql_username, $mssql_password) or die(odbc_errormsg());