From: Gerardo L. <gl...@ad...> - 2011-07-12 18:12:18
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body bgcolor="#ffffff" text="#000000"> Hi, I try to connect to a firebird 2 database via php - odbc driver, but i can't.<br> <br> My php code is<br> <?php<br> $dbh = odbc_connect('bd1','',''); <br> $res = odbc_exec($dbh, 'select * from personas');<br> ?><br> <br> And when execute results in this error:<br> <br> <b>Warning</b>: odbc_exec() [<a href="http://nicasio/MisPhp/Clipper/prottv/function.odbc-exec">function.odbc-exec</a>]: SQL error: [unixODBC][ODBC Firebird Driver][Firebird]invalid database handle (no active connection), SQL state S1000 in SQLExecDirect in <b>/media/windowsd/Informacion/Gerardo/MisPhp/Clipper/prottv/prueba1.php</b> on line <b>3</b><br> <br> Is like, the connection fails isn't it? But when I try to connect from other sources, like OpenOfficeBase or the utility "DataManager" from unixodbc i can connect. Even had some problems with the utility ODBCConfig from unixodbc. When i try use it for create de Dsn drivers, it show a error message "Could not construct a property list for (Firebird)" and fires me away. Then I create the content of the odbcinst.ini odbc.ini with a scite text procesor.<br> <br> Well I triying to resolve this five days ago , find documentation, the web etc. etc. and I can't solve it.<br> <br> Could you helpme ? Below (some aditional data about my configuration files)<br> Thanks in advance from Uruguay<br> Gerardo<br> <br> I' Using Ubuntu Linux 8.04 LTS<br> Install unixodbc, and the firebird driver (libOdbcFb.so in /usr/lib/odbc) and restart the lighty web server.<br> <br> <b>My odbcinst.ini file on /etc is</b><br> <br> <br> [ODBC]<br> FileDSNPath = /etc/ODBCDataSources/<br> <br> [Firebird]<br> Description = InterBase/Firebird ODBC Driver<br> Driver = /usr/lib/odbc/libOdbcFb.so<br> Driver64 = <br> Setup = /usr/lib/odbc/libOdbcFb.so<br> Setup64 = <br> UsageCount = <br> CPTimeout = <br> CPReuse = <b><br> <br> My odbc.ini file on /etc is </b><br> <br> [BDBam]<br> Description = Otra base Firebird <br> Driver = Firebird<br> Dbname = localhost:/media/windowsd/Informacion/Gerardo/MisPhp/Clipper/BDBam.fdb<br> User = sysdba<br> Password =masterkey<br> [bd1]<br> Description = Prototitpo TodoTv. base firebird<br> Driver = Firebird<br> Dbname = nicasio:/media/windowsd/Informacion/Gerardo/MisPhp/Clipper/bdProTTV.fdb<br> User = sysdba<br> Password =masterkey<br> Role =<br> CharacterSet =<br> ReadOnly = No<br> NoWait = No<br> <br> <br> </body> </html> |