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.

MORE INFORMATION

To reproduce the problem:

  1. Create a Visual C++ 6.0 wizard-generated ATL OLE DB Provider.
  2. Create a Visual Basic 6.0 project and add a data environment to the project by clicking More ActiveX Designers from the Project menu.


  1. Right-click the connection and choose the ATL provider you have created.
  2. Right-click the connection object and add a command.
  3. Change the CommandText property to the following: C:\*.*
RESULTS: You see the error message.

Modification Type:MajorLast Reviewed:10/24/2003
Keywords:kbprb kbProvider KB198492