Article ID: 198492
Article Last Modified on 10/24/2003
APPLIES TO
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
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.
Additional query words: kbDSupport
Keywords: kbprovider kbprb KB198492