views:

212

answers:

1

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?

+2  A: 

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.

ctacke
Can it be done with a COM object?
Martinho Fernandes
Or with ODBC?.................
Martinho Fernandes
The COmpact Framework does not support ODBC, so that's completely out. You could certainly write a COM object in C++ that talks to the database and then go through the huge effort of wrapping the COM object with a CF object, but it would be *way* less effort to just create a WCF service.
ctacke