PDO Microsoft Access
I am running linux from bluehost and have PDO installed. I wish to access *.mdb info, however I cannot seem to开发者_JS百科 get past the connection string for PDO in this case.
$dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdb;Uid=Admin");
Generates error: SQLSTATE[IM002] SQLDriverConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified
I know the the path is correct: /home1/[Removed]/pss/pss.md
Does anyone know of any solution to this issue using the PDO library?
As requested, expanding on my comment.
MDB support on Linux is limited; although MDB Tools (used by PDO on Linux) does provide partial read-only support, the general status seems far from production ready, as the FAQ says
1.2 What does MDB Tools do
MDB Tools is an open source suite of libraries and utilities to read (and soon write) MDB database files.
1.6 Is there a roadmap?
Roughly, the plan moving forward looks like this.
- Add index scan capability to libmdb and the SQL engine with a query plan generator.
- Add support for adding rows to existing tables and an mdb-import tool.
- Add full write support to libmdb and libmdbsql.
- Extract queries, table properties, VBA script, forms.
- mdb-check database consistancy checker and recovery tool.
- Add joins.
- Ability to add tables.
If you only need to read the .mdb, then installing mdbtools might be good enough.
If you need read-write, or any of the features on the roadmap, and must use .mdb, then use a Windows or possibly Mac host
If the .mdb is just a datasource, export it to SQL and use MySQL or PostGres (PostGres seems to have better ODBC support for Windows, if this is relevant to your project)
精彩评论