By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,834 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

odbc_connect (PHP + MSSQL) problems

P: n/a
Hi all,

I have tried connect to remote MS SQL server with no success. Anyone
help me?

###this is the code used to try connect

$dsn = "Driver={SQL Server};Server=200.xxx.xxx.xxx;Database=Mydb;";
$user = 'WebService';
$pass = 'triad';

if(odbc_connect($dsn, $user, $pass)){
echo "I got it!.";
}
###This is the error

Warning: odbc_connect() [function.odbc-connect]: SQL error:
[unixODBC][Driver Manager]Data source name not found, and no default
driver specified, SQL state IM002 in SQLConnect in
/home/triadbra/public_html/desenvolvimento/digs/teste2.php on line 8

anyone have any idea to solve this problem? i have a linux server with
PHP and a remote sql server

Jun 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Filipe Tomita <fi***********@gmail.com> wrote:
[unixODBC][Driver Manager]Data source name not found


I suppose you have unixODBC installed and data source name configured
for Microsoft SQL Server? Next step is to tell PHP where it can find
your ODBC configuration file:

putenv('ODBCINI=/path/to/odbc.ini');

Also make sure that your web server has permission to read that file.

--
Jari
Jun 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.