Starting at the beginning ...
For many people, the "beginning" is programming in Office using VBA, so here's the story on that. In the series 'About' VBA, I demonstrated how easy it was to 'instantiate' objects from other environments and use them in a VBA program with an Office application - such as Access! So the first question about ADO .NET might be, "Great! How do I use it in Access?"
Unfortunately, it can't be done according to Microsoft. ADO .NET was designed to work with .NET and not COM (the technology used by Office and VBA). Microsoft explains that even if you go through the steps to force Office to recognize ADO .NET, it still doesn't work:
"If you run RegAsm.exe (the Assembly Registration Tool in the .NET Frameworks SDK) to register System.Data.dll with COM (on which Office VBA is based), and then try to reference the generated type library file from Office, you will get no exposed members in the Office Visual Basic Object Browser. This is because COM fails to recognize core private ADO .NET members and parameterized constructors. So, for now at least, you should continue to use ADO in Office VBA."
Well ... it would have been nice. But stay tuned! Microsoft is just now (May 2003) releasing a new version of Office that allows it to call VB .NET programs. It's currently in beta test, but we'll provide more information when things firm up.
But even though you can't use ADO .NET in Access, you certainly can use it with an Access database.
Since there's a good chance that you will want to build your own database rather than using the Microsoft Northwind sample, a very simple Access database was constructed containing data about recent About Visual Basic Spotlight articles. Here's what that looks like:
Next page >
The OleDbDataReader Object > Page
1,
2,
3,
4,
5,
6