ADO.NET and MSFT Access 2007

J

Jeff Gaines

I am using the trial version of Office 2007 (I am awaiting delivery of my
own version) having taken a large leap from Office 97.

I accessed the 97 version of Access using ADODB but, if it makes sense, I
want to try and learn how to use ADO.NET with the new version. I write
Windows Forms apps in C# for my own enjoyment/education. (which may mean I
am asking in the wrong group)

I started up a new project and fell at the first hurdle because VS2005
doesn't recognise the new Access format (.accdb). So question 1 is is
there an add on/upgrade available or do I have to save my shiny new Access
databases in the 2003 format?

I don't like using the Data Connector etc. controls, I have always found
it easier and quicker to roll my own in code.
I am used to using ADODB.Connection and ADODB.Recordset and connection
strings like:
"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=";...

So question 2 is is it possible to carry on using that technique with
ADO.NET or should I learn to use the built in controls?

I would appreciate any thoughts and pointers to sample projects/how to's,
this may be the biggest leap I have made since the days of VB6 :)

Many thanks.
 
P

Paul Clement

¤ I am using the trial version of Office 2007 (I am awaiting delivery of my
¤ own version) having taken a large leap from Office 97.
¤
¤ I accessed the 97 version of Access using ADODB but, if it makes sense, I
¤ want to try and learn how to use ADO.NET with the new version. I write
¤ Windows Forms apps in C# for my own enjoyment/education. (which may mean I
¤ am asking in the wrong group)
¤
¤ I started up a new project and fell at the first hurdle because VS2005
¤ doesn't recognise the new Access format (.accdb). So question 1 is is
¤ there an add on/upgrade available or do I have to save my shiny new Access
¤ databases in the 2003 format?
¤
¤ I don't like using the Data Connector etc. controls, I have always found
¤ it easier and quicker to roll my own in code.
¤ I am used to using ADODB.Connection and ADODB.Recordset and connection
¤ strings like:
¤ "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=";...
¤
¤ So question 2 is is it possible to carry on using that technique with
¤ ADO.NET or should I learn to use the built in controls?
¤
¤ I would appreciate any thoughts and pointers to sample projects/how to's,
¤ this may be the biggest leap I have made since the days of VB6 :)

The Access 2007 database format requires the use of a new OLEDB provider.

http://www.connectionstrings.com/?carrier=access2007


Paul
~~~~
Microsoft MVP (Visual Basic)
 
W

WenYuan Wang [MSFT]

Hello Jeff,
Thanks for Robbe's help.

It seesm Robbe has provide a great sample code for you.

For Access 2007 database: the connection string should looks as below

Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database
Password=MyDbPassword;

http://www.connectionstrings.com/?carrier=access2007
[ACE OLEDB 12.0 Connect string]

Data Connectivity Components could be download from below.

http://www.microsoft.com/downloads/details.aspx?FamilyID=7554f536-8c28-4598-
9b72-ef94e038c891&displaylang=en
[2007 Office System Driver: Data Connectivity Components]

Hope this helps. Please let me know if you have any more concern. We are
glad to assist you.
Have a great day.
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jeff Gaines

Hello Jeff,
Thanks for Robbe's help.

It seesm Robbe has provide a great sample code for you.

Yes, many thanks Robbe :)
I will have to have a real think about that app, I want to try and
understand what it is doing!
Data Connectivity Components could be download from below.

http://www.microsoft.com/downloads/details.aspx?FamilyID=7554f536-8c28-4598-
9b72-ef94e038c891&displaylang=en
[2007 Office System Driver: Data Connectivity Components]

I really have to do something about my Googling skills, I did spend an
hour last night looking but didn't find that :-(
Thank you very much, down-loaded, installed, a couple of changes to my app
for the connection string and it just works!

Many thanks to Paul also for the connection string link :)

Apologies for my confusion but it seems to me that I am still using ADODB
to access my database - is that correct?

If so should I try and make the transition to ADO.NET or is that
just/mainly for web applications or for other data sources?

Thanks again for all the very prompt replies :)
 
W

WenYuan Wang [MSFT]

Hello Jeff,
Thanks for your reply.

Microsoft.ACE.OLEDB.12.0 is an OLE-DB-type data provider, which could be
used for both ADO.net(OleDb) and ADODB.
If so should I try and make the transition to ADO.NET or is that
just/mainly for web applications or for other data sources?

This is dependent on your project. ADO.net could provide some new features
such as DataSet,DBDataAdapter...
For more information, you may refer to the following article:
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/adoplusoverview.as
px
[ADO.NET Overview]

In general, I'd like to suggest you choose ADO.net rather than ADODB.
However, if your ADODB code works fine so far, I think we don't have to
bother to migrate from ADODB to ADO.net.

By the way, I searched on internet and found an article about Using ADO.net
http://www.codeproject.com/cs/database/DatabaseAcessWithAdoNet1.asp
[Using ADO.NET for beginners]

Hope this helps. Let me know if you have any more concern. I'm glad to
assist you.
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jeff Gaines

In general, I'd like to suggest you choose ADO.net rather than ADODB.
However, if your ADODB code works fine so far, I think we don't have to
bother to migrate from ADODB to ADO.net.

Many thanks, Wen, I will read up and persevere with ADO.NET :)

I think I can stick with ADO/ADODB for now though, it looks easy to change
once I know what I am doing.
 
W

WenYuan Wang [MSFT]

You are welcome, Jeff.

Have a great day,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top