Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for December, 2009

FIX: ADO: Unable To Update Memo Field > 64K In Access Database

Symptoms
An attempt to update a large (64K or greater) memo field in a client-siderecordset using the Jet 3.51 OLE DB provider results in one of the followingerrors:

Errors occurred.
Run-time error ‘-2147217887(80040e21)’:-or-

Run-time error ‘-2147217259(80040005)’:Data provider or other service returned an E_FAIL status.
Resolution
This problem is caused by a bug in the Microsoft OLE DB Provider for Jetversion 3.51.

FIX: Application Error When Binding Dynamically-Created Control

Symptoms
An application error occurs when a Visual Basic program dynamically createsa text box bound to a remote data control or a data control.
Resolution
Microsoft has confirmed this to be a bug in the Microsoft products listedat the beginning of this article. This bug has been corrected in VisualBasic, version 5.0.

FIX: ADO DataControl and DataEnvironment Events Only Work with ADO 2.0

Symptoms
When you attempt to use the events of an ADO Data Control or the DataEnvironment with a reference to a version of the Microsoft ActiveX Data Objects (ADO) later than version 2.0, you receive the following error message:

Compile error:
Procedure declaration does not match description of event or procedure having the same name.
Resolution
The ADO Data Control and the Data Environment were compiled using Microsoft Data Access Components version 2.0.

FIX: Adding Subitems To Hidden ListView Causes APP Error

Symptoms
A 32-bit Visual Basic application with a ListView control can generate anapplication error or incorrectly display the subitems if the subitems areadded to a ListView control that is hidden on a form.
Resolution
To eliminate this behavior, use one of the following methods:
If you want your ListView control in the form to be hidden when the formis shown, toggle the Visible property once before adding the subitems tothe ListView control. To toggle the Visible property, initially set theVisible property to True and then reset the Visible property to False.
-or-
At design time, set the ListView control Visible property to True. Then inthe first line of code in the form’s Load procedure, set the ListViewcontrol Visible property to False.

FIX: AddConfiguration Method Fails for Makefile Projects

Symptoms
The AddConfiguration automation method fails with the following error when called from a Developer Studio macro and the active project is a makefile project:

The configuration could not be added to the project.
Resolution
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:
194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why?(http://support.microsoft.com/kb/194022/EN-US/)
194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed?(http://support.microsoft.com/kb/194295/EN-US/)

FIX: “Unhandled exception” error message when you use Visual Basic 6.0 components from managed code

Symptoms
When you use Visual Basic 6.0 components in your managed code, you may receive “Unhandled Exception” error messages.
Resolution
Older versions of the Visual Basic 6.0 runtime (Msvbvm60.dll) have a shutdown problem that manifests as an “Unhandled Exception” error when you use Visual Basic 6.0 components from managed code.