Get All Supported OLE Data Providers

  • Thread starter Thread starter Mark Bernardinis
  • Start date Start date
M

Mark Bernardinis

I was just wondering if there is a way in CSharp to list all of the
available OLE Data Providers in the system?

Mark
 
Mark,

I would imagine that all OLE data providers implement a certain COM
component category. If you know what this category is, you can get the
default implementation of the ICatInformation interface (through COM
interop) and then call the EnumClassesOfCategories method on it, which will
return the classes registered for a particular category.

Hope this helps.
 
Hi,

Thanks for your reply. I did a little more researching on this and I found
an article on Experts Exchange. I will list it here as follows as this is
close to what I am looking for (it is probably what you were describing
except accessing the registry directly.
If you really want a list of every OLE DB Provider, you can scan the
HKEY_CLASSES_ROOT\CLSID\ and retain every key where there is a "OLE DB
Provider" subkey. The default value of this subkey is the name of the OLE DB
Provider.

There is although a C+ example of using the OLE DB root enumerator (which
does what you want) at
http://msdn.microsoft.com/library/en-us/oledb/htm/olprchapter02_5.asp
Do you see any problems with using this approach compared to the way you
described it?

Mark

Nicholas Paldino said:
Mark,

I would imagine that all OLE data providers implement a certain COM
component category. If you know what this category is, you can get the
default implementation of the ICatInformation interface (through COM
interop) and then call the EnumClassesOfCategories method on it, which will
return the classes registered for a particular category.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Mark Bernardinis said:
I was just wondering if there is a way in CSharp to list all of the
available OLE Data Providers in the system?

Mark
 
Back
Top