Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if an OLEDB driver is installed on the system?

Tags:

delphi

oledb

ado

How can I make sure that a certain OLEDB driver is installed when I start my application? I use ADO from Delphi and would like to display a descriptive error message if the driver is missing. The error that's returned from ADO isn't always that user-friendly.

There are probably a nice little function that returns all installed drivers but I haven't found it.

like image 779
Karl-Otto Rosenqvist Avatar asked Sep 22 '08 08:09

Karl-Otto Rosenqvist


People also ask

Where is OLE DB driver installed?

The header and library files for OLE DB Driver for SQL Server (msoledbsql. h and msoledbsql. lib/msoledbsql19. lib) are installed in %PROGRAMFILES%\Microsoft SQL Server\Client SDK\OLEDB\<major_version><minor_version>\SDK .

How do I know if my Microsoft ACE OLE DB 12.0 driver is installed?

Navigate to Start, and enter C:\Windows\System32\odbcad32.exe into the Search programs and files field. When the ODBC Administrator opens, click the Drivers tab and look for Microsoft Excel Driver or Microsoft Access Driver. If these drivers are present, this confirms the existence of 64-bit ACE components.

How do I check my ODBC driver version in Windows?

In Administative Tools, double-click Data Sources (ODBC). Click the Drivers tab. Information for the Microsoft SQL Server entry is displayed in the Version column.

What is Microsoft OLE DB driver?

OLE DB Driver for SQL Server was designed to provide a simplified method of gaining native data access to SQL Server using OLE DB. It provides a way to innovate and evolve new data access features without changing the current Windows DAC components, which are now part of the Microsoft Windows platform.


1 Answers

This is an old question but I had the same problem now and maybe this can help others.

In Delphi 7 there is an procedure in ADODB that return a TStringList with the provider names.

Usage example:

names := TStringList.Create;
ADODB.GetProviderNames(names);

if names.IndexOf('SQLNCLI10')<>-1 then
  st := 'Provider=SQLNCLI10;'
else if names.IndexOf('SQLNCLI')<>-1 then
  st := 'Provider=SQLNCLI;'
else if names.IndexOf('SQLOLEDB')<>-1 then
  st := 'Provider=SQLOLEDB;';
like image 105
Rogerio Ueda Avatar answered Oct 13 '22 22:10

Rogerio Ueda