[unixODBC-support] Problem using DSN string on functionodbc_connect php4

Stefan Radman Stefan.Radman at CTBTO.ORG
Fri Mar 18 15:14:00 GMT 2005


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

Try:

$con = odbc_connect("Driver=TDS; Server=192.168.1.50;
Database=ADM","user", "pass")

Does that work?

Stefan

> -----Original Message-----
> From: unixodbc-support-bounces at easysoft.com 
> [mailto:unixodbc-support-bounces at easysoft.com] On Behalf Of 
> Felipe Roman
> Sent: Friday, 18 March, 2005 14:37
> To: unixodbc-support at easysoft.com
> Subject: [unixODBC-support] Problem using DSN string on 
> functionodbc_connect php4
> 
> 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 
> 
> _______________________________________________
> unixODBC-support mailing list
> unixODBC-support at easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-support
> 




More information about the unixODBC-support mailing list