[unixODBC-support] access MS SQL Server with php4

Felipe Roman felipe at fonet-br.com
Mon May 16 20:32:21 BST 2005


Hi,
    I installed a unixodbc on debian gnu/linux sarge and when
run in a shell return

fonethttpd:/# isql FonetODBC sa 123
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> fonethttpd:/#

but when I using in php4 scripts 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/fonet/templates/db.php on line 13

packages installed:
ii unixodbc
ii freetds-dev
ii php4-odbc
ii php4-sybase

my conf files

cat freetds.conf
[FonetODBC]
query tcp ether 192.168.1.55 1433
master tcp ether 192.168.1.55 1433

cat odbc.ini
[FonetODBC]
Driver          = /usr/lib/odbc/libtdsodbc.so
Description     = Acesso a base SQL Server
Server          = 192.168.1.55
FileUsage       = 1

cat odbcint.ini
[FonetODBC]
Driver          = /usr/lib/odbc/libtdsodbc.so
Description     = Acesso a base SQL Server
Server          = 192.168.1.55
FileUsage       = 1

fonethttpd:/etc/odbc# cat tds.driver.template
[TDS]
Description = v0.52 with protocol v4.2
Driver = /usr/lib/odbc/libtdsodbc.so

fonethttpd:/etc/odbc# cat tds.data.template
[FonetODBC]
# Driver = /usr/lib/odbc/libtdsodbc.so
Driver = TDS
Description = Acesso a base SQL Server
Server = 192.168.1.50

fonethttpd:/etc/php4/apache# cat php.ini
extension=sybase_ct.so
extension=odbc.so

Any ideas?

Thank you,

-- 
Felipe Roman - Desenvolvedor
Fonet Soluções de Telemática Ltda
http://www.fonet-br.com
ICQ UIN 43399880




More information about the unixODBC-support mailing list