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
namespace Common {
public class CLSIDHelper {
[DllImport("ole32.dll")]
static extern int CLSIDFromProgID([MarshalAs(UnmanagedType.LPWStr)] string lpszProgID, out Guid pclsid);
public static Guid RetrieveGUID(string Provider) {
Guid CLSID = Guid.Empty;
int Ok = CLSIDFromProgID(Provider, out CLSID);
if (Ok == 0)
return CLSID;
return null;
}
}
}