From: <hak...@mp...> - 2005-01-12 11:08:23
Attachments:
hakan.stroberg.vcf
|
Hi, I want to access *.mdb files within my php scripts. I have a Linux web=20 server with unixODBC installed. When I access the database with the=20 following php code: <?php $mydb =3D odbc_connect("MSAccess-dummy","",""); $query =3D "select * from Addresses"; $result =3D odbc_exec($mydb,$query); $report =3D odbc_fetch_row($result); echo odbc_result($result, 1); odbc_close($mydb); ?> I get this error back: *Warning*: SQL error: [unixODBC]Could not find Database parameter, SQL=20 state 08001 in SQLConnect in */usr/local/httpd/htdocs/odbc.php* on line *= 3* *Warning*: odbc_exec(): supplied argument is not a valid ODBC-Link=20 resource in */usr/local/httpd/htdocs/odbc.php* on line *5* *Warning*: odbc_fetch_row(): supplied argument is not a valid ODBC=20 result resource in */usr/local/httpd/htdocs/odbc.php* on line *6* *Warning*: odbc_result(): supplied argument is not a valid ODBC result=20 resource in */usr/local/httpd/htdocs/odbc.php* on line *7* *Warning*: odbc_close(): supplied argument is not a valid ODBC-Link=20 resource in */usr/local/httpd/htdocs/odbc.php* on line *8* The triling warnings are due to the first one but what am I missing???=20 Which parameter?? I downloaded the latest sources from MDBTools repository and used the=20 following configuration: $ ./configure --prefix=3D/usr/local/mdbodbc=20 --with-unixodbc=3D/usr/local/unixODBC --enable-sql My odbcinst.ini looks like: [MDBODBC] Description =3D MDB Tools ODBC Driver Driver =3D /usr/local/mdbodbc/lib/libmdbodbc.so Setup =3D FileUsage =3D 1 CPTimeout =3D CPReuse =3D My odbc.ini file looks like: [MSAccess-dummy] Description =3D Microsoft Access Events database Driver =3D MDBODBC Database =3D /home/hakans/dummy.mdb Servername =3D localhost UserName =3D Password =3D Port =3D 5432 $ ll /home/hakans/dummy.mdb -rw-r--r-- 1 hakans users 180224 Jan 12 11:10 /home/hakans/dummy.mdb Grateful for any kind of help. Regards, /H=E5kan |
From: <hak...@mp...> - 2005-01-12 10:39:58
Attachments:
hakan.stroberg.vcf
|
Hi, I want to access *.mdb files within my php scripts. I have a Linux web=20 server with unixODBC installed. When I access the database with the=20 following php code: <?php $mydb =3D odbc_connect("MSAccess-dummy","",""); $query =3D "select * from Addresses"; $result =3D odbc_exec($mydb,$query); $report =3D odbc_fetch_row($result); echo odbc_result($result, 1); odbc_close($mydb); ?> I get this error back: *Warning*: SQL error: [unixODBC]Could not find Database parameter, SQL=20 state 08001 in SQLConnect in */usr/local/httpd/htdocs/odbc.php* on line *= 3* *Warning*: odbc_exec(): supplied argument is not a valid ODBC-Link=20 resource in */usr/local/httpd/htdocs/odbc.php* on line *5* *Warning*: odbc_fetch_row(): supplied argument is not a valid ODBC=20 result resource in */usr/local/httpd/htdocs/odbc.php* on line *6* *Warning*: odbc_result(): supplied argument is not a valid ODBC result=20 resource in */usr/local/httpd/htdocs/odbc.php* on line *7* *Warning*: odbc_close(): supplied argument is not a valid ODBC-Link=20 resource in */usr/local/httpd/htdocs/odbc.php* on line *8* The triling warnings are due to the first one but what am I missing???=20 Which parameter?? I downloaded the latest sources from MDBTools repository and used the=20 following configuration: $ ./configure --prefix=3D/usr/local/mdbodbc=20 --with-unixodbc=3D/usr/local/unixODBC --enable-sql My odbcinst.ini looks like: [MDBODBC] Description =3D MDB Tools ODBC Driver Driver =3D /usr/local/mdbodbc/lib/libmdbodbc.so Setup =3D FileUsage =3D 1 CPTimeout =3D CPReuse =3D My odbc.ini file looks like: [MSAccess-dummy] Description =3D Microsoft Access Events database Driver =3D MDBODBC Database =3D /home/hakans/dummy.mdb Servername =3D localhost UserName =3D Password =3D Port =3D 5432 $ ll /home/hakans/dummy.mdb -rw-r--r-- 1 hakans users 180224 Jan 12 11:10 /home/hakans/dummy.mdb Grateful for any kind of help. Regards, /H=E5kan |
From: Jeff S. <why...@ya...> - 2005-01-15 15:00:10
|
The only way to get the error... > Could not find Database parameter, SQL state 08001 in SQLConnect should be the entry having an empty Database parameter ("Database =") or not having a Database parameter at all. As your entry seems to have a valid Database parameter, one thing I can think of is that there is another 'MSAccess-dummy' entry that is being picked up, perhaps from the user's .odbc.ini file. Another (remote) possibility may be that libodbcinst was not picked up when you were configuring/compiling. Do an 'ldd $YOUR_MDBTOOLS_PATH/lib/libmdbodbc.so' and see if libodbcinst is in the list of linked libraries. If not, that may be a problem. > I downloaded the latest sources from MDBTools repository and used the > following configuration: By this, I assume you mean the MDBTools' CVS repository. -- Jeff Smith __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: <hak...@mp...> - 2005-01-17 11:32:27
Attachments:
hakan.stroberg.vcf
|
Hi Jeff, The problem was that libodbcinst was not among the linked libraries. When I compiled unixODBC it was named libodbcinst, not libodbcinst.so.=20 So when a configured MDBTools it could not be found and hence not linked=20 (no errors though). I created a symlink called libodbcinst.so,=20 configured and compiled MDBTools again. This solved the problem. Thanks!! /H=E5kan Jeff Smith wrote: >The only way to get the error... > > =20 > >>Could not find Database parameter, SQL state 08001 in SQLConnect >> =20 >> > >should be the entry having an empty Database parameter ("Database =3D") >or not having a Database parameter at all. As your entry seems to >have a valid Database parameter, one thing I can think of is that >there is another 'MSAccess-dummy' entry that is being picked up, >perhaps from the user's .odbc.ini file. > >Another (remote) possibility may be that libodbcinst was not picked >up when you were configuring/compiling. Do an >'ldd $YOUR_MDBTOOLS_PATH/lib/libmdbodbc.so' and see if libodbcinst >is in the list of linked libraries. If not, that may be a problem. > > =20 > >>I downloaded the latest sources from MDBTools repository and used the=20 >>following configuration: >> =20 >> > >By this, I assume you mean the MDBTools' CVS repository. > > -- Jeff Smith > >__________________________________________________ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around=20 >http://mail.yahoo.com=20 > =20 > --=20 M.Sc. H=E5kan Str=F6berg Marquardt & Partners AB M=E4ster Samuelsgatan 9 111 44 STOCKHOLM Tel. 08 - 440 36 75 Mobil 0709 - 46 68 79 Fax. 08 - 440 36 71 |