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 Tagged ‘application error’

BUG: Text Box and Data Control on a UserControl Closes UserControl in the IDE

Symptoms
A Standard EXE or UserControl form contains a second UserControl. The second UserControl contains a text box and a data control. You close all the forms and then open the second UserControl. When you attempt to change the DataSource property of the text box in the property window, the UserControl immediately closes or an application error occurs that causes Visual Basic to stop responding.
Resolution
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

BUG: Property Page of Remote Data Control Causes an Error

Symptoms
Pressing the ESC key while the cursor is in the SQL text box of theGeneral Tab in the property page of the Remote Data Control causes a blankGeneral tab. When you click the Colors tab and then click the General tabagain, an application error occurs and Visual Basic ends. The SQL text boxcan be empty or contain characters. Clicking the Cancel button on thewindow correctly closes the window. This behavior only occurs under theWindows 95 operating system.To work around this behavior, programmatically set the properties ofremote data control or use the Properties window of the Remote Data Objectto set the properties.
Resolution
Microsoft has confirmed this to be an issue in the Microsoft productslisted at the beginning of this article. Microsoft is researching thisissue and will post new information here in the Microsoft Knowledge Baseas it becomes available.

BUG: Error When Data Control Is Set to a Wrong Text Database

Symptoms
A 16-bit Visual Basic for Windows version 4.0 program containing a Datacontrol with a Connect property set to Text and the DatabaseName propertyset to a non-text database generates an application error when run. Theapplication error displays the message – VB caused a General ProtectionFault in module VB.EXE at 003F:2106. Choose close. VB will close.
A 32-bit Visual Basic for Windows version 4.0 program with the same controlset to the same property displays the error message – Couldn’t find object.
Resolution
Microsoft has confirmed this to be an issue in the Microsoft productslisted at the beginning of this article. Microsoft is researching thisissue and will post new information here in the Microsoft Knowledge Baseas it becomes available.

BUG: Error Occurs When Printing a Form Stored in an Array

Symptoms
An application error occurs when calling the Print method of a form objectcontained within a form array.
Resolution
To work around this problem, define a non-array form variable and set thevariable to reference the form array element that you want to manipulate.Once this variable has been initialized, you can safely call the Printmethod of the newly defined Form variable, as shown in the example below:

Private Sub Form_Load()Dim MyForm As FormDim fl(1) As Form2Set fl(0) = New Form2Set MyForm = fl(0)MyForm.Show’Show the Form2 formMyForm.Print ‘Print the form to the screenEnd Sub

FIX: Error When Closing a Program Through the Control Box

Symptoms
An application error occurs when you close a Visual Basic program throughthe control box if the Visual Basic program executes a command after anobject created from a class module is set to nothing. This problem occursonly in the 32-bit edition of Visual Basic 4.0.
Resolution
The workaround to this issue is execute all the code in the event beforesetting the object to nothing. The statement to set the object to nothingshould be the last line in the event procedure.

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.