Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. ADO and ODBC - confused

ADO and ODBC - confused

Scheduled Pinned Locked Moved Database
databasemysqloraclecomquestion
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tom Wright
    wrote on last edited by
    #1

    I improved on an application that was found on this site (OQuery). I made it so that it could access different types of DBMS such as MySQL, Oracle (which is originally did), MS-SQL 2000. I had two people ask me if I used ODBC which I replied that I used ADO. I'm a little confused because now I'm having trouble with the differences between ADO and ODBC. I thought ADO ends up using ODBC....right? I've also heard that an ODBC connection is 10 slower than that of ADO....can someone confirm this. And should I be using ODBC? Thanks

    Tom Wright tawright915@gmail.com

    B M 2 Replies Last reply
    0
    • T Tom Wright

      I improved on an application that was found on this site (OQuery). I made it so that it could access different types of DBMS such as MySQL, Oracle (which is originally did), MS-SQL 2000. I had two people ask me if I used ODBC which I replied that I used ADO. I'm a little confused because now I'm having trouble with the differences between ADO and ODBC. I thought ADO ends up using ODBC....right? I've also heard that an ODBC connection is 10 slower than that of ADO....can someone confirm this. And should I be using ODBC? Thanks

      Tom Wright tawright915@gmail.com

      B Offline
      B Offline
      Bert delaVega
      wrote on last edited by
      #2

      Yes, ADO is a wrapper to ODBC. But I think you really mean ADO.Net?

      T 1 Reply Last reply
      0
      • B Bert delaVega

        Yes, ADO is a wrapper to ODBC. But I think you really mean ADO.Net?

        T Offline
        T Offline
        Tom Wright
        wrote on last edited by
        #3

        Yes...ADO.NET. So why am I being asked if I used ODBC. Is there some ODBC secret that's not being shared that I should know about? Thanks

        Tom Wright tawright915@gmail.com

        B 1 Reply Last reply
        0
        • T Tom Wright

          I improved on an application that was found on this site (OQuery). I made it so that it could access different types of DBMS such as MySQL, Oracle (which is originally did), MS-SQL 2000. I had two people ask me if I used ODBC which I replied that I used ADO. I'm a little confused because now I'm having trouble with the differences between ADO and ODBC. I thought ADO ends up using ODBC....right? I've also heard that an ODBC connection is 10 slower than that of ADO....can someone confirm this. And should I be using ODBC? Thanks

          Tom Wright tawright915@gmail.com

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          ADO is a wrapper for a technology called OLE DB, although it has little to do with OLE (Object Linking and Embedding). The database-specific layer (called a Provider) is a set of COM objects which implement interfaces designed by Microsoft. The client talks directly to the OLE DB provider with no intermediary. ADO is a classic VB-friendly wrapper for OLE DB. ODBC (Open Database Connectivity) is based around a manager/driver model. Applications talk to the ODBC manager, which talks to the drivers. The extra overhead is generally minimal. ODBC is the ANSI standard interface defined in the SQL standard. To enable transition to ADO/OLE DB from ODBC, i.e. so that client application developers could use the new interface before the database developers released OLE DB providers, Microsoft made a special provider called the OLE DB Provider For ODBC available (its ProgID, which you specify in the Provider connection string parameter, is MSDASQL). You should only use this where there is no native OLE DB provider. This provider adds extra overhead and implements a reduced feature set compared to native OLE DB providers. Unfortunately it's also the default provider - it's what you get if you don't specify a Provider in the connection string. The relative speed of ODBC and ADO is all down to the provider and driver, but in general, all else being equal, ADO should be slightly faster than ODBC if you're using a native OLE DB provider. ADO.NET is slightly misnamed in the .NET Framework. It's really a general umbrella name for 'how .NET does data access'. The desktop Framework ships with four Providers (the name is the same but the concepts have changed) - two generic (OLE DB, ODBC) and two specific (SQL Server, Oracle [since 1.1]). You can also obtain third-party Providers. The cost of calling a COM object is slightly higher than calling a 'flat' API like ODBC in the .NET Framework, so OLE DB's small performance advantage is mostly negated. You can access a third-party database like MySQL either through a native .NET provider or via an OLE DB provider (using OleDbConnection) or ODBC driver (using OdbcConnection). Generally you should prefer a native .NET provider as it's likely to have more features and less translation.

          Stability. What an interesting concept. -- Chris Maunder

          T 1 Reply Last reply
          0
          • M Mike Dimmick

            ADO is a wrapper for a technology called OLE DB, although it has little to do with OLE (Object Linking and Embedding). The database-specific layer (called a Provider) is a set of COM objects which implement interfaces designed by Microsoft. The client talks directly to the OLE DB provider with no intermediary. ADO is a classic VB-friendly wrapper for OLE DB. ODBC (Open Database Connectivity) is based around a manager/driver model. Applications talk to the ODBC manager, which talks to the drivers. The extra overhead is generally minimal. ODBC is the ANSI standard interface defined in the SQL standard. To enable transition to ADO/OLE DB from ODBC, i.e. so that client application developers could use the new interface before the database developers released OLE DB providers, Microsoft made a special provider called the OLE DB Provider For ODBC available (its ProgID, which you specify in the Provider connection string parameter, is MSDASQL). You should only use this where there is no native OLE DB provider. This provider adds extra overhead and implements a reduced feature set compared to native OLE DB providers. Unfortunately it's also the default provider - it's what you get if you don't specify a Provider in the connection string. The relative speed of ODBC and ADO is all down to the provider and driver, but in general, all else being equal, ADO should be slightly faster than ODBC if you're using a native OLE DB provider. ADO.NET is slightly misnamed in the .NET Framework. It's really a general umbrella name for 'how .NET does data access'. The desktop Framework ships with four Providers (the name is the same but the concepts have changed) - two generic (OLE DB, ODBC) and two specific (SQL Server, Oracle [since 1.1]). You can also obtain third-party Providers. The cost of calling a COM object is slightly higher than calling a 'flat' API like ODBC in the .NET Framework, so OLE DB's small performance advantage is mostly negated. You can access a third-party database like MySQL either through a native .NET provider or via an OLE DB provider (using OleDbConnection) or ODBC driver (using OdbcConnection). Generally you should prefer a native .NET provider as it's likely to have more features and less translation.

            Stability. What an interesting concept. -- Chris Maunder

            T Offline
            T Offline
            Tom Wright
            wrote on last edited by
            #5

            Wow.....thanks for the great explination. Okay so if the database creator....for better use of the word....provides a .NET provider then it's best to use it. And if I wanted to add an "Other Database" option to my program...I can always use ODBC to connect to the "Other" database and run a query. I guess the great thing about ODBC is that I would not have to install all the providers for each of the different types of DB's out there. So now I understand why I keep getting asked if I'm using ODBC. DING....the light came on

            Tom Wright tawright915@gmail.com

            P 1 Reply Last reply
            0
            • T Tom Wright

              Yes...ADO.NET. So why am I being asked if I used ODBC. Is there some ODBC secret that's not being shared that I should know about? Thanks

              Tom Wright tawright915@gmail.com

              B Offline
              B Offline
              Bert delaVega
              wrote on last edited by
              #6

              lol, not at all. ODBC is very old and low level. ADO.net, however, is a new(er) implementation for data access and pretty fast. For one, it allows for disconnected datasources which, in itself, is much more efficient for the server (server doesn't have to manage connections). Perfect for web apps. ODBC was used more for the old client/server connected model. It almost sounds like you're being asked about ODBC because the datasource they want to use doesn't have an ADO.NET connector available?

              T 1 Reply Last reply
              0
              • B Bert delaVega

                lol, not at all. ODBC is very old and low level. ADO.net, however, is a new(er) implementation for data access and pretty fast. For one, it allows for disconnected datasources which, in itself, is much more efficient for the server (server doesn't have to manage connections). Perfect for web apps. ODBC was used more for the old client/server connected model. It almost sounds like you're being asked about ODBC because the datasource they want to use doesn't have an ADO.NET connector available?

                T Offline
                T Offline
                Tom Wright
                wrote on last edited by
                #7

                That's possible...although all of the options that I've added to my app have a .NET connector. I'm also wondering is they are asking that because have a different provider for each type of database is not really important. Between you an Mike, you'ver really cleared this up....now I look and sound smarter. Thanks

                Tom Wright tawright915@gmail.com

                1 Reply Last reply
                0
                • T Tom Wright

                  Wow.....thanks for the great explination. Okay so if the database creator....for better use of the word....provides a .NET provider then it's best to use it. And if I wanted to add an "Other Database" option to my program...I can always use ODBC to connect to the "Other" database and run a query. I guess the great thing about ODBC is that I would not have to install all the providers for each of the different types of DB's out there. So now I understand why I keep getting asked if I'm using ODBC. DING....the light came on

                  Tom Wright tawright915@gmail.com

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  It's worth knowing that the native providers, e.g. the SQL Server providers, generally use the databases native API, so you get the best speed because they aren't dealing with the plumbing that technologies that ODBC put in place.

                  Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups