[unixODBC-support] Problem using DSN string on function odbc_connect php4

Felipe Roman felipe at fonet-br.com
Fri Mar 18 13:37:11 GMT 2005


Hi,
   I am using debian sarge + apache 1.3 + php 4.3.10 + unixodbc 
2.2.4 and other server with MS SQL Server 2000.

The UnixODBC is configured:
debian:/etc/php4/apache# isql odbc user pass
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+

and in my php scripts where I using 
$con = odbc_connect("ODBC", "user", "pass");

connect normaly, but I need select the database name in SQL Server using
DSN String

$con = odbc_connect("Driver={SQL Server}; Server=ODBC; Database=ADM",
"user", "pass");

Return 

Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]
Data source name not found, and no default driver specified, SQL 
state IM002 in SQLConnect in /var/www/teste.php on line 2

Any help will be welcome,

Regards,

-- 
Felipe Roman
FONET-BR
http://www.fonet-br.com
felipe at fonet-br.com 




More information about the unixODBC-support mailing list