PC Review


Reply
Thread Tools Rate Thread

Is ADO.NET OleDb .NET Data Provider a COM object?

 
 
Mark Worsnop
Guest
Posts: n/a
 
      3rd Nov 2008
I read that it is a COM wrapper, and if that is the case then why not use the
ADO MDAC as that for sure uses the COM object?

Every where I read says do not use the ADO for VB6, and convert. But I do
not want to be stuck only on SQL Server. Even though that is all I use, I
would also like to have it set so that I could use MySql or another DB at
some time.


 
Reply With Quote
 
 
 
 
Norman Yuan
Guest
Posts: n/a
 
      3rd Nov 2008

"Mark Worsnop" <(E-Mail Removed)> wrote in message
news:3D7E0745-A5B8-4B4A-88FB-(E-Mail Removed)...
>I read that it is a COM wrapper, and if that is the case then why not use
>the
> ADO MDAC as that for sure uses the COM object?
>
> Every where I read says do not use the ADO for VB6, and convert. But I do



Who said that? You need to make sure that you know ADO and ADO.NET are
completely different things.

ADO+VB6 is a good fit, while in .NET you can still use ADO, but it is a bad
choice. You can use ADO.NET with all sorts of database server, be itSQL
Server, or MySQL...


> not want to be stuck only on SQL Server. Even though that is all I use, I
> would also like to have it set so that I could use MySql or another DB at
> some time.
>
>


 
Reply With Quote
 
Mark Worsnop
Guest
Posts: n/a
 
      3rd Nov 2008
There is 2 different ADO.NET adapters, OleDB and Native SQL. The SQL is a
direct connection to the SQL Server.

The OleDB I think still uses the COM wrapper.

If it actually does, then why not use the ADO COM?

 
Reply With Quote
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      3rd Nov 2008
Okay, okay... let's add some clarity here.
First let's define some terms. COM means you build code that depends on
external COM components that might be replaced (often arbitrarily) AFTER
your application has been deployed--even before it runs for the first time.
IMHO COM is a big problem in many environments.
OLE DB is a one-size-fits-all (OSFA) set of providers that can access
anything from a relational database to a tuna salad (unless it has dill
pickles). The spec is as complicated as a pork-filled bill sent out of the
House. OLE DB is based on COM (see above). In the past, in order to access
SQL Server we used OLE DB to access ODBC (the Kagera bridge) or SQL Server.
Today, you can/should use the SNAC OLE DB provider to access SQL Server--but
it's still COM.

A telephone is an example of an OSFA provider. However, just because you can
dial (or push buttons), it does not mean you can order pizza from that guy
in Peru that does not speak English. In a similar way, just because you can
connect to MySQL, Paradox, Oracle or FarkleStar databases from an OLE DB or
other OSFA provider does not mean your code can interface with these other
back-ends. Each has its own unique characteristics, features, weaknesses and
strengths. One might support stored procedures, another not. One might
support BLOBs or enough capacity to store images in the database, another
might not. Some are designed for multi-user architectures, others struggle
to support a single user. The differences in administration, performance,
capacity, compatibility and everything else make writing an OSFA application
of your own a living, breathing nightmare. Yes, it's been done but is the
application competitive? It often takes complex multi-tiered architectures
that dereference the actual data access interfaces and implementations.
Possible? Sure--got a PhD in computer science or a dozen year experience?
Got someone who'll pay for this beast?

Accessing ADO via OLEDB (or the OleDb namespace in .NET) is problematic.
Yes, it has to traverse the COM interop layer which does NOT map the entire
functionality you use to access ADO COM objects in VB6. I documented a
half-dozen cases where the COM interop failed to return the same results or
was even accepted in .NET code--the only reason some of these applications
worked was "side-effect" or unintended functionality exposed by the COM
objects created in VB6. In other words, it only worked by accident.

I hope this answers your question.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________



"Mark Worsnop" <(E-Mail Removed)> wrote in message
news:22440644-8139-423D-B245-(E-Mail Removed)...
> There is 2 different ADO.NET adapters, OleDB and Native SQL. The SQL is a
> direct connection to the SQL Server.
>
> The OleDB I think still uses the COM wrapper.
>
> If it actually does, then why not use the ADO COM?
>

 
Reply With Quote
 
Mark Worsnop
Guest
Posts: n/a
 
      3rd Nov 2008
So if I want my application to be able to use SQL server or MySql for
example, the only choice I have is using the OleDB, is that correct. I do
know there are differences in the way you talk to the DB regardless of how
you get there.

If I do us the OleDB and that uses the COM wrapper, then I might as well
use the COM that I used in VB6 too or are they different.

As there is no other way to access MySql other than the OleDB am I to assume
that its ok to use this? Is there another choice?

Thanks for all your input!

 
Reply With Quote
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      3rd Nov 2008
Ah, first, COM is simply the interface, not the objects to which it
connects.

I recommend that you give up on COM-based ADO if you're working with a .NET
language. (period)

Yes, I expect there are MySQL ODBC drivers and there are MySQL .NET native
providers. I found one here
http://dev.mysql.com/downloads/connector/net/5.0.html. There might be
others. I would (always) recommend a .NET native provider over an OLE DB (or
ODBC) provider. As I discuss in my latest book, using ODBC drivers to access
databases is also faster and less trouble-prone than OLE DB as the interface
is (again) managed code.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________



"Mark Worsnop" <(E-Mail Removed)> wrote in message
news:278F2FC8-3B41-4139-9E53-(E-Mail Removed)...
> So if I want my application to be able to use SQL server or MySql for
> example, the only choice I have is using the OleDB, is that correct. I do
> know there are differences in the way you talk to the DB regardless of how
> you get there.
>
> If I do us the OleDB and that uses the COM wrapper, then I might as well
> use the COM that I used in VB6 too or are they different.
>
> As there is no other way to access MySql other than the OleDB am I to
> assume
> that its ok to use this? Is there another choice?
>
> Thanks for all your input!
>

 
Reply With Quote
 
Mark Worsnop
Guest
Posts: n/a
 
      3rd Nov 2008
But am I understanding correctly, if there is not a NET driver available, and
you use the OleDB then its like using the ADO COM?

I guess I should have looked for Native NET drivers, before I said anything.
I read your book and it said the NET driver only supported MS SQL. Never
thought of looking for drivers, my bad.

I have almost completed making a DLL that I am going to use in my
application that simulates all of the ADOc function calls. That will make
converting the existing VB6 code tons easier. I will use this for about 90%
of the main code and manually rewrite all of those that are too complicated.


 
Reply With Quote
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      4th Nov 2008
Ah, cloning ADO classic functionality might be pretty complex as ADO.NET
does not implement the default ADO classic Recordset or its server-side
cursor functionality. I think many developers have chosen to evaluate each
of the data access routines at a somewhat higher level. This permits them to
code classes that do the same thing in ADO.NET without all of the issues
involving "emulating" the Recordset behavior. That is, if a query runs a
query and returns a rowset, you code a Command object, process the
parameters, execute the Command and process the rowset.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________



"Mark Worsnop" <(E-Mail Removed)> wrote in message
news:5F06DDE1-6B92-4664-B441-(E-Mail Removed)...
> But am I understanding correctly, if there is not a NET driver available,
> and
> you use the OleDB then its like using the ADO COM?
>
> I guess I should have looked for Native NET drivers, before I said
> anything.
> I read your book and it said the NET driver only supported MS SQL. Never
> thought of looking for drivers, my bad.
>
> I have almost completed making a DLL that I am going to use in my
> application that simulates all of the ADOc function calls. That will make
> converting the existing VB6 code tons easier. I will use this for about
> 90%
> of the main code and manually rewrite all of those that are too
> complicated.
>
>

 
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
The .Net Data OLE DB Provider(System.Data.OleDb) requires Microsoft Data Access Components(MDAC) version 2.6 or later. sanjay prasad Microsoft ADO .NET 1 22nd Sep 2006 01:45 AM
.NET Data Provider/OLEDB Colin J Paterson Microsoft ADO .NET 0 8th Mar 2006 03:29 PM
Can you package a oledb data provider? =?Utf-8?B?QnJpYW4=?= Microsoft ADO .NET 1 3rd Dec 2004 04:14 PM
Reading data from text files using oledb provider Jomon Mathew Microsoft Dot NET 1 30th Mar 2004 06:07 PM
Re: Sybase OleDB Data Provider William \(Bill\) Vaughn Microsoft ADO .NET 0 15th Jul 2003 05:50 PM


Features
 

Advertising
 

Newsgroups
 


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