This article was previously published under Q223180
This article has been archived. It is offered "as is" and will no longer be updated.
In this article
When using the Jet OLE DB Provider 4.0 with a Wizard-generated Active Template Library (ATL) OLE DB Consumer template class, a call to the Open or OpenDataSource method returns an HRESULT of DB_E_ERRORSOCCURRED.
The ATL OLE DB Consumer Wizard generates an OpenDataSource method that includes DBPROP_PERSIST_SENSITIVE_AUTHINFO as one of the initialization properties for the provider. The Jet OLE DB Provider 4.0 is not designed to accept this property and returns an HRESULT of DB_E_ERRORSOCCURRED.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/194022/EN-US/ )INFO: Visual Studio 6.0 Service Packs, What, Where, Why
(http://support.microsoft.com/kb/194295/EN-US/ )HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
When the ATL OLE DB Consumer Wizard generates a consumer template class using the Jet OLE DB Provider, it generates an OpenDataSource method as in the following code example:
If you comment out the following line, the method does not generate a DB_E_ERRORSOCCURRED HRESULT with the Jet OLE DB Provider 4.0:
The updated ATL OLE DB Consumer Wizard installed by Visual C++ version 6.0 Service Pack 3 does not include this line of code when it generates a consumer template class for the provider, thus avoiding this error.
Article ID: 223180
Last review: October 26, 2013