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 ‘windows version’

PRB: Type Mismatch with Default Prop of VB4 Data Access Object

Symptoms
Some data access objects in Visual Basic for Windows version 4.0 no longerhave the default “Name” property. Instead, these objects now have a defaultcollection. This change can lead to “Type Mismatch” (Error 13) or “InvalidArgument” (Error 3001) errors when attempting to run your code.
Resolution
To work around this problem, add the name of the property you want toreference.
For example, use this:

MsgBox Data1.Database.TableDefs(0).Name instead of this:

MsgBox Data1.Database.TablesDefs(0)

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.

FIX: Can’t Have Menu with No Caption Bar/Buttons/Control Box

Symptoms
You can’t add a menu that has no caption, no maximize/minimize buttons,and no control-menu box to a form.
Resolution
This feature is not supported in Visual Basic in Windows version 3.0or 3.1 because of a bug in the Microsoft Windows menu driver thatprevents Windows from painting menus correctly.