difference between OleDBConnection and SqlConnection?

  • Thread starter Thread starter cody
  • Start date Start date
C

cody

What is the difference between OleDBConnection and SqlConnection?
Or better expressed, what is OleDB?
 
They are two different implementations of IDBConnection. SqlConnection is
the SqlServer implementation, OleDb was everything 'else' . That's been
minimized to some degree since the addition of the ODBC and Oracle libraries
in the 1.1 framework so OleDbConnection should probably be renamed to
PeopleWhoStillUseMSAccessConnection

The answer to your question though. Back in the old school days, a bunch of
VB programmers started whining b/c data access was too hard. So Microsoft
came out with ODBC which was an agreed upon spec that you could use to
access any database that complied with it. They still complained that it
was still to hard. So they came up with OleDB, the next version of
DataAccessForEveryone. From there things morphed into ADO and then more
recently ADO.NET. But basically it's just a spec that vendors can agree or
not agree to abide by, most have but some haven't.

Bill

--just joking about the VB Programmers, it's a running joke with a few
people that read this NG regularly.
 
from what I read...

SqlConnection is solely used against mssql servers...
whereas OldDBConnection in general uses any ODBC compliant driver
 
SqlConnection is solely used against mssql servers...
whereas OldDBConnection in general uses any ODBC compliant driver


so what is OdbcConnection good for if OleDBConnection does the same work?
 
Cody, you can use any of the three on SqlServer for instance, just as you
can use the OracleDB, OleDb or Odbc for Oracle.

Since the maturation of the technologies spanned quite a time frame, many
vendors provided support for multiple specs. In general, many suggest that
you use as specific a provider as possible if you want to take full
advantage of the DB features.
 
Cody, you can use any of the three on SqlServer for instance, just as you
can use the OracleDB, OleDb or Odbc for Oracle.

Since the maturation of the technologies spanned quite a time frame, many
vendors provided support for multiple specs. In general, many suggest that
you use as specific a provider as possible if you want to take full
advantage of the DB features.


thank you!
 
¤ What is the difference between OleDBConnection and SqlConnection?
¤ Or better expressed, what is OleDB?

OLEDB is based upon COM (Component Object Model) so ultimately the code that executes is unmanaged
(interop). System.Data.OleDb is simply a .NET managed namespace (wrapper) for the COM OLEDB
providers.

AFAIK, the System.Data.SqlClient namespace is a fully native .NET managed provider and is
recommended if you are using SQL Server.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Back
Top