Link to home
Start Free TrialLog in
Avatar of RayT
RayTFlag for United States of America

asked on

Connecting To MS Access Using .NET Compact Framwork 3.5

How do you connect to a Microsoft Access database using the .Net Compact Framework 3.5?

Is this possible with code (Visual Basic)?
SOLUTION
Avatar of Juan_Barrera
Juan_Barrera
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RayT

ASKER

Thanks for your suggestion.  It did not work.  However,  I did find the following namespaces but no examples on how to use them.

It appears they are to be used when developing a mobile application
.NET Compact Framework
Supported in: 3.5, 2.0

Imports System.Data
Imports System.Data.Common
Didn't work the code or the namespaces? You should be able to use the OleDb provider in mobile applications...
And, as you can see, OleDb is contained inside System.Data.
Avatar of Éric Moreau
instead of using a .mdb file, consider using SQL Server Compact: http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx
Avatar of RayT

ASKER

Here's the error I see when I add the following code to the project

Imports Data.OleDb
Data.OleDb-Error.bmp
if you check http://msdn.microsoft.com/en-us/library/system.data.oledb.aspx, you clearly see in the square (top right) that the compact framework is not listed.

not all classes are implemented in the compact framework to save space.
The top right square (the one listing the Framework versions) doesn't indicate which version supports what class, unless we are talking about different squares :)
Have a look, for example, at this page for example: http://msdn.microsoft.com/en-us/library/ms180729.aspx
There is no indication of .NET Compact Framework in the top right gray square, although nobody would argue that it's not supported.

Sorry, I was wrong. But have a look at http://msdn.microsoft.com/en-us/library/system.string.aspx. Near the bottom, you will find "Version Information" in which ".Net Compact Framework" is clearly listed.

Now go back to the OLEDB class and pick any member (like http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbcommand.aspx) and you will find that the Compact Framework is not listed in the "Version Information" section.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RayT

ASKER

Thanks!!!