locked
Can OLEDB be used for Oracle, MySQL, Sybase databases? RRS feed

  • Question

  • User460266172 posted

    I just want to know if the OLEDB can be used to access and manipulate all of Oracle, Sybase, MySQL, etc databases. If no, what is the best approach to developing an application that is required to be compatible with any database? Thanks

    Monday, August 12, 2013 5:31 AM

Answers

  • User-760709272 posted

    ODBC is the older standard for connecting to databases, and any system that uses the ODBC API can use an ODBC driver to interface with the database.  OLEDB is a Windows API that was intended to work with a wider range of data sources, not just databases.  There is also an OLEDB provider for ODBC datasources, so you are sometimes using OLEDB to manipulate ODBC which manipulates your data.  This obviously won't perform as well as more direct drivers.

    If your data source has a native .net provider (SqlConnection etc) then you should use it.  If they have an OLEDB driver you should use that. If they only have ODBC then you should use that.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 12, 2013 6:59 AM

All replies

  • User-837620913 posted

    You can use OLEDB as I believe all of those databases support OLEDB. If you have others you would have to check.

    But if you are developing in .NET, look for a .NET provider for each of those platforms. Those usually are faster and better than OLEDB, but not always so you'll have to test to make sure (I for one have had issues with the Oracle Data Provider for .NET (ODP.NET) but it's been a few years, maybe they have fixed it).

    Here are .NET providers for the three you mentioned:

    Oracle: http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

    Sybase: http://www.sybase.com/products/databasemanagement/advantagedatabaseserver/net-data-provider

    MySql: http://dev.mysql.com/downloads/connector/net/

    Monday, August 12, 2013 5:44 AM
  • User-760709272 posted

    As long as there is an OLEDB driver for your datasource, you can use the oledb objects to manipulate them.  There are drivers for MySQL etc, and there is actually an in-built access for Oracle the same way there is for SQL, you have OracleConnection etc.

    Monday, August 12, 2013 5:45 AM
  • User460266172 posted

    Thanks Darrel.

    What is the difference between OLEDB and ODBC. Which one is more recent/better. Which one should be prefered? Thanks.

    Monday, August 12, 2013 6:10 AM
  • User-760709272 posted

    ODBC is the older standard for connecting to databases, and any system that uses the ODBC API can use an ODBC driver to interface with the database.  OLEDB is a Windows API that was intended to work with a wider range of data sources, not just databases.  There is also an OLEDB provider for ODBC datasources, so you are sometimes using OLEDB to manipulate ODBC which manipulates your data.  This obviously won't perform as well as more direct drivers.

    If your data source has a native .net provider (SqlConnection etc) then you should use it.  If they have an OLEDB driver you should use that. If they only have ODBC then you should use that.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 12, 2013 6:59 AM