oledb vs odbc

VAer 756 Reputation points
2021-01-24T05:20:25.537+00:00

I have asked quite some questions recently, and some people provides answer with oledb. I can feel oledb connection is better and popular.

As a non-IT professional who occasionally build some small appplications to improve work process efficiency, I only know ODBC connection.

The reason I only know ODBC connection: if I look up www.connectionstrings.com , I can find related database information from ODBC Data Source (see screenshot).

So my question: in order to use OLEDB connection string, where should I find related database information? How should I know what kind of OLE DB provider for my workplace laptop? Step by step, where can I find the related information for OLEDB connection. For OLEDB, I don't know where to begin (it is hard for non-IT professional and no computer science background).

All I know is that: there are many oce type on workplace shared drive (see screenshot).

Thanks.

59893-odbc.jpg

59916-oce.jpg

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,828 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,697 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,236 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yitzhak Khabinsky 24,946 Reputation points
    2021-01-24T21:14:28.833+00:00

    To find out what OLEDB providers/drivers are installed is very easy via a universal data link file (udl).

    Here is how.
    By using notepad.exe editor please create an empty text file with the extension .udl
    Right mouse click on that file in the File Explorer, and select properties.
    Upon clicking on the Provider tab, a list of all installed OLEDB providers shows up.
    Additionally, a udl file allows to create and test connections.

    Please see below.

    59875-udl.png


2 additional answers

Sort by: Most helpful
  1. Dan Guzman 9,206 Reputation points
    2021-01-24T15:17:17.483+00:00

    You tagged your question with SQL Server, C# and WinForms. If you are only using these technologies, it would be easiest to use the managed System.Data.SqlClient provider included with .NET instead of an unmanaged OLEDB or ODBC driver. This will perform better and avoid the need to install a separate driver. The authoritative source for SqlClient connection strings is the SqlClient connection string documentation page https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnection.connectionstring.

    If you target other DBMS products, similarly download and use their managed provider if one is available. Use OLEDB/ODBC in .NET applications only when no managed provider is available for the DBMS.

    So my question: in order to use OLEDB connection string, where should I find related database information? How should I know what kind of OLE DB provider for my workplace laptop? Step by step, where can I find the related information for OLEDB connection.

    Use the latest SQL Server OLE DB driver if you also develop unmanaged applications for SQL Server. The official connection string documentation is this page. You'll need to download and install the driver before using it.

    2 people found this answer helpful.
    0 comments No comments

  2. Castorix31 81,636 Reputation points
    2021-01-24T09:38:39.14+00:00

    It depends on which database you want to access

    For example, for Office databases, you can use the ACE OLEDB Provider (which must be installed, for example the 2016 version)
    or also the old Jet OLE DB 4.0 Provider