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 February, 2011

PRB: RepairDatabase Method Is No Longer Available in DAO 3.6

Symptoms
If you issue a DbEngine.RepairDatabase method after you change your project references from Microsoft DAO 3.51 Object Library to Microsoft DAO 3.6 Object Library, you may receive the following error message:

Error # 3251 was generated by DAO.DbEngine.
Operation is not supported for this type of object.Or, you may notice that the method is not available through IntelliSense when you issue a DbEngine.RepairDatabase method.
Resolution
In Data Access Object (DAO) 3.6, the RepairDatabase method is no longer available or supported. This is by design to match Microsoft Jet 4.0.

PRB: RDO/Jet: Run-Time Error 40069; Client Cursor Error 11 or 12

Symptoms
When you run a SELECT statement against the Microsoft Jet ODBC driver usingRDO and the client batch cursor engine, you receive one of the followingtwo error messages:

Run-time error 40069
Client Cursor: 11 – No update tables are specified
-or-

Run-time error ‘40069′:
Client Cursor: 12 – No key columns are specified for the update table
Resolution
When using the client batch cursor engine, and opening a static resultset,you must use the same case as in the table when typing field names into theSELECT clause of the SQL statement. This applies to the primary key fieldand any BLOB (Binary Long Object) columns–LongVarChar and LongVarBinary.

PRB: Poor Performance with the GoSub Statement

Symptoms
A project compiled in native code shows poor performance. This behavioroccurs because the project contains calls to subroutines using the GoSubstatement.
Resolution
The GoSub statement has not been optimized in Visual Basic.

PRB: RDC/ODBC Password Display Inconsistencies

Symptoms
When setting the password property of the RemoteData Control (RDC) atdesign time in the Property Window, asterisks are not substituted for thepassword characters. When the ODBC dialog box is displayed, the password isconverted into asterisks.
Resolution
The RDC does not control the edit field in the Property Window, andtherefore cannot force asterisks to be displayed. An OLE custom controldoes not have direct control over the Property window supplied by theVisual Basic design environment. The Remote Data control does correctly useasterisks in its own Property page.

PRB: IntelliSense Features Do Not Appear in Visual Basic 6.0 for .NET COM Interop Components

Symptoms
When you register a Microsoft Visual Basic .NET Component for COM Interop in the registry by using the Register for COM Interop option in Visual Studio .NET, the IntelliSense features for the methods and properties of the classes do not appear in your Visual Basic 6.0 application. Also, you cannot use early binding to bind to a method or a property.
Resolution
This problem occurs in the following scenario:When you use the Register for COM Interop option, the Visual Studio .NET build process calls the Regasm tool with the /TLB and /CODEBASE options to register the .NET Component for COM Interop.When you call to the Regasm tool, Visual Studio .NET creates a type library and a COM Callable Wrapper (CCW) Interop assembly.The type library is registered and acts as a COM object to gain access to the .NET assembly.By default, the Regasm tool creates a type library that exposes a non-dual, empty IDispatch interface. Therefore, you cannot use early binding. If you do not use early binding, the IntelliSense features do not appear.