Currently I have a website running on a Windows machine at a hostingprovider. On that Windows machine I have a connection to a mdb database using the following code:

new PDO("odbc:DRIVER=Microsoft Access Driver (*.mdb); DBQ=$this->dbName; Uid=; Pwd=;");

This is all working fine.

Now I would like to do the same, but then on a linux machine at another hostingprovider (which is cheaper). I only have FTP access to the webserver. I can't install anything on the webserver.

Offcourse the linux machine does not have the Microsof Acces Driver, but it has unixODBC installed.

I can't create a dsn so I think I need a dsn-less connection.

Can unixODBC be used to connect to an Access database?

How should I create a connection to the mdb database on a linux webserver?

有帮助吗?

解决方案

You might have unixODBC installed but you still need a Microsoft Access ODBC Driver and one does not come with unixODBC. There are only 2 I know of for Linux and both would need installing (however, that is still possible with FTP). The 2 I know are MDB tools which is free and the Easysoft MS Access ODBC Driver which you need to purchase. I've never had much luck with MDB tools (various ODBC functions did not work and I don't think it is maintained). I know the Easysoft driver works as I've used it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top