PC Review


Reply
Thread Tools Rate Thread

ADO.NET and MSFT Access 2007

 
 
Jeff Gaines
Guest
Posts: n/a
 
      30th Aug 2007
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.

--
Jeff Gaines
 
Reply With Quote
 
 
 
 
Robbe Morris - [MVP] C#
Guest
Posts: n/a
 
      30th Aug 2007
You could just have the .net code generated for you:

http://www.eggheadcafe.com/articles/..._generator.asp

Run the generator against your database and then review the
OleDb .NET code it generates.

--
Robbe Morris
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx




"Jeff Gaines" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.
>
> --
> Jeff Gaines


 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      30th Aug 2007
On Wed, 29 Aug 2007 16:52:05 -0700, "Jeff Gaines" <(E-Mail Removed)> wrote:

¤ 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)
 
Reply With Quote
 
WenYuan Wang [MSFT]
Guest
Posts: n/a
 
      30th Aug 2007
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 OLEDBatabase
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/d...536-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.

 
Reply With Quote
 
Jeff Gaines
Guest
Posts: n/a
 
      30th Aug 2007
On 30/08/2007 in message <(E-Mail Removed)> WenYuan
Wang [MSFT] wrote:

>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/d...536-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 :-)

--
Jeff Gaines
 
Reply With Quote
 
WenYuan Wang [MSFT]
Guest
Posts: n/a
 
      31st Aug 2007
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/quickst...lusoverview.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/databa...ithAdoNet1.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.

 
Reply With Quote
 
Jeff Gaines
Guest
Posts: n/a
 
      31st Aug 2007
On 31/08/2007 in message <(E-Mail Removed)> WenYuan
Wang [MSFT] wrote:

>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.

--
Jeff Gaines
 
Reply With Quote
 
WenYuan Wang [MSFT]
Guest
Posts: n/a
 
      3rd Sep 2007

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.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 can't send/receive after VISTA upgrade from MSFT 12 J Rob-San Diego Microsoft Outlook Discussion 7 19th Jun 2009 07:57 PM
Re: msft home office 2007 download on 64 bit system Richard G. Harper Windows Vista General Discussion 0 22nd Jan 2009 10:50 AM
I have Msft office 2007, but Excell & word dosn't show in program. i'VE LOST WORD & EXCELL. Microsoft Excel Misc 1 25th Dec 2008 11:27 PM
MSFT in the US Supreme Court MSFT vs. AT&T (05-1056) 2/21/07) Chad Harris Windows Vista General Discussion 6 23rd Feb 2007 07:19 AM
OT-MSFT servers(ng's and Office 2007) is this a glimpse of SPP? Jeff Windows Vista General Discussion 5 29th Oct 2006 11:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:30 AM.