问题
I am developing a Compact Framework application that needs to manipulate an existing MS Access database. Apparently the CF has no support for Access databases, or even ODBC. How can I do this, without changing the database?
回答1:
The answer, in short, is that you don't. The CF has no ability to attach to an Access database, remote or local.
Now if the database is on a PC, what I'd be inclided to do is create a simple WCF service that provides access (no pun intended) to the database by either exposing methods specific to your data domain (e.g. GetCustomerByID) or generically (e.g. ExecutSQL).
Doing so adds a lot of complexity, though, because now you don't jsut have the app, you have a service and the connectivity pipeline to maintain as well.
If there's any way around it, I'd sure try to get the data in a SQL Compact store.
来源:https://stackoverflow.com/questions/1651755/how-do-i-use-an-ms-access-database-with-the-compact-framework