Microsoft KB Archive/254633

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Knowledge Base

OmniProv.exe - A Sample ATL OLEDB Provider for Custom Databases

Article ID: 254633

Article Last Modified on 8/9/2004


  • Microsoft OLE DB 2.7, when used with:
    • Microsoft Visual C++ 6.0 Enterprise Edition
    • Microsoft Visual C++ 6.0 Professional Edition
    • Microsoft Visual C++ 6.0 Standard Edition

This article was previously published under Q254633


OmniProv.exe is a sample that is comprised of sample code and an explanation of a simple ATL OLE DB provider called OmniProv.exe version 1.0. Full documentation on this provider can be found in the white paper located here:

Following is an excerpt from the white paper:

"The inability and inordinate struggles and frustrations of innumerable customers to create a custom provider that works with the Microsoft DataGrid Control 6.0 (OLEDB) and the Microsoft ADO Data Control 6.0 (OLEDB) on its own steam without the scores of error messages popping out has been the motivation behind writing this provider - OmniProv1.0. Its endeavor is to demonstrate not only how to interface a custom ATL OLEDB Provider with the ActiveX Controls using server-side cursors; but to also possess the capability to reliably perform inserts, updates and deletes maintaining consistency in a back-end custom database. Finally, it also offers an example for exposing data to consumers via text files that possess their own individual schematic data."

Internals of OmniProv.exe

OmniProv.exe version 1.0 works with the ADO DataGrid using server-side cursors and is capable of supporting non-deferred updates, inserts and deletes. It contains a storage class that implements the custom database that is comprised of a Schema and a Data file.
The Storage class initially reads the schema file pointed to by the Data Source property of the connection string. From the schema file OmniProv.exe version 1.0 discerns what to expect from the data file. Grammar and schema of the custom database is explained in the white paper. The white paper further explains the interfaces required to interface with the ADO DataGrid client. Additionally, testing with a Visual Basic ADO client and usage of IRowsetViewer with OmniProv.exe version 1.0 are explained. The white paper also enumerates the limitations of Omniprov.exe and an explanation of error messages for this sample encountered with the ATL OLEDB provider.


The following files are available for download from the Microsoft Download Center:


For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.


  • OLE DB 2.0 Programmer's Reference
  • The following topics in the MSDN Library:

In the Visual C++ documentation on the OLE DB Provider Templates:

    • Creating an OLE DB Template Provider
    • Using the OLE DB Provider Templates
    • Macros for OLE DB Provider Templates
    • FAQ: Using the OLE DB Provider Templates
    • Enhancing the Simple Read-Only Provider
  • In the OLE DB Template Samples in the Visual C++ documentation:

    • PROVIDER: OLE DB Provider Templates Sample
  • In the ADO Technical Articles:

    • Mapping ADO Methods to OLE DB Interfaces
  • In the Visual C++ Technical Articles:

    • Using the Visual C++ 6.0 OLE DB Provider Templates

NOTE: These references can be found online in the MSDN Library here:

NOTE: The sample does not use the ATL _ATL_DEBUG_INTERFACES and will not work with OLE DB Services because of a refcount problem which is exposed. Any providers that implement separate C++ objects for each interface (as is the case with _ATL_DEBUG_INTERFACES) may encounter an internal access violation in OLE DB Services, which causes E_UNEXPECTED ("catastrophic failure") to be returned from the service.

Additional query words: OmniProv custom provider proprietary oledb vc templates

Keywords: kbinfo kbdownload kbprovider kbdatabase kbfile kbsample kbdtl KB254633