PRB: "Unspecified Error" with ATL Provider in Data Environment (198492)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q198492 SYMPTOMS
When using an ATL wizard-generated OLE DB Provider in the Visual Basic 6.0
Data Environment, a message box with the message "Unspecified Error"
occurs. This error occurs after clicking the Command object and changing
the CommandText property.
CAUSE
By default, the ATL OLE DB-generated provider places the following code in
the Property maps for the OLE DB data source object:
PROPERTY_INFO_ENTRY(INIT_MODE)
The default value for the property is 0 (zero), which causes the Visual
Basic Data Environment to select all of the mode check boxes under the
Advanced tab of the Connection properties dialog box. When the Data
Environment attempts to connect, it attempts to set the mode and fails.
RESOLUTION
The user can explicitly set the check boxes in the Advanced tab.
This error can also be avoided by setting the DBPROP_INIT_MODE provider
property to a default value of something other than 0, such as
DB_MODE_READ.
To change the ATL OLE DB Provider, change the datasource property from the
following
PROPERTY_INFO_ENTRY(INIT_MODE)
to the following:
PROPERTY_INFO_ENTRY_VALUE(INIT_MODE, DB_MODE_READ)
STATUS
While the OLE DB specification states that it is correct to have zero as a
value, it is recommended that a provider supply a nonzero default value for
the provider.
Modification Type: | Major | Last Reviewed: | 10/24/2003 |
---|
Keywords: | kbprb kbProvider KB198492 |
---|
|