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 ‘Wizard’

BUG: Data Form Wizard Through Application Wizard Omits ADO Reference

Symptoms
When you run an application that is created using the Visual Basic Application Wizard, you receive the following error message:

Compile error: User-defined type not defined
Resolution
The Application Wizard allows for the creation of forms via the Data FormWizard. When a form is created in this manner, a reference to ADO is notadded to the project.

BUG: The Visual Basic .NET or Visual Basic 2005 Upgrade Wizard reports an incorrect warning message for user-defined data types

Symptoms
If you use Visual Basic Upgrade Wizard on your Microsoft Visual Basic 6.0 project with a user-defined data type, the wizard generates a warning message for the code with user-defined data type assignments. For example, you may receive the following warning message for a direct user-defined data type assignment.

UPGRADE_WARNING: Could not resolve default property of object <<UDT>>. Click for more information: ‘ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword=”vbup1037′
Resolution
The wizard incorrectly treats the user-defined data type variables as a class object, and then tries to locate the default property for the object. The user-defined data type does not have default properties. Therefore, the wizard cannot locate a default property, and it reports an incorrect warning.

BUG: Queries or Views Do Not Appear in Data Form Wizard

Symptoms
When you use the Data Form Wizard, queries or views do not appear in thelist of available record sources.
Resolution
The Data Form Wizard incorrectly queries only for tables to populate thedrop-down combo box of available record sources.

BUG: Error at run time after you upgrade a Microsoft Visual Basic 6.0 project that uses the ImageList control to Microsoft Visual Basic .NET

Symptoms
When you upgrade a Microsoft Visual Basic 6.0 project that uses the ImageList control to a Microsoft Visual Basic .NET project by using the Microsoft Visual Basic .NET Upgrade Wizard, you receive the following exception when you run the project in Visual Basic .NET:

An unhandled exception of type ‘System.Runtime.InteropServices.COMException’ occurred in axinterop.mscomctllib.dll
Resolution
The Visual Basic .NET Upgrade Wizard wraps the ImageList control in the AxHost class. However, it does not modify the corresponding Visual Basic 6.0 code to access the underlying ImageList control. For example, the following code may be part of the migrated Visual Basic .NET code.

ListView1.ColumnHeaderIcons = ImageList

BUG: Data Form Wizard Mishandles ‘-’ in Table or Field Names

Symptoms
When loading a form created by the Data Form Wizard, you may receive one ofthe following error messages:

Run-time error ‘-214217900 (80040e14)’, “Syntax error in FROM clause”
-or-

Run-time error ‘-214217904 (80040e10)’, “No value given for one or morerequired parameters”
Resolution
If the data source for a form created by the Data Form Wizard containsa dash ‘-’ in its name or in the name of a field, it is required that thedata source name or field name be delimited by brackets in a SQL statement.The Data Form Wizard does not include brackets around these names.

PRB This Action was Cancelled by an Associated Object.(3426)”

Symptoms
This article discusses the error message “This action was cancelled by anassociated object.” that Visual Basic generates when working with Accessdatabases and the Data control. This article does not apply to the ADO datacontrol.
Resolution
This error is being generated because the AddNew command of a boundrecordset causes Visual Basic to try to save the current record if the datahas changed. Because the data control is currently pointing to a NULLrecord and not an empty record, the data cannot be saved so the “action wascancelled by an associated object” error is reported. This is commonly seenwhen using the data form wizard in Visual Basic versions 4.0 and 5.0. Thedata form wizard in Visual Basic 6.0 generates code for the ADO datacontrol so this error is less likely to occur.