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

FIX: You cannot insert empty string into Memo, Text, nText, or Blob columns

Symptoms
When you try to insert an empty string into Memo, Text, nText or Blob columns by using the OLE DB .NET data provider, you receive the following exception:

An unhandled exception of type ‘System.InvalidOperationException’ occurred in system.data.dll If you handle this exception within a try-catch block, you receive the following information:

System.InvalidOperationException
System.Data.OleDb.OleDbException: Multiple-Step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Resolution
To work around this problem: For strings, insert a space that has a length greater than zero (such as ” “), instead of using an empty string.If the database has an Allow Nulls setting, select Allow Nulls for the columns in the database, and treat nulls as empty strings.

PRB: Cannot Use Data Transformation Services Event Handlers in Visual Basic with Execute Package Task

Symptoms
If you install Data Transformation Services (DTS) Package event handlers in a Visual Basic application, and the package you call uses an Execute Package task to call another package, an Exception Access Violation (AV) similar to the following may occur:

(1:Child Package) SubStep ‘<title of step> Step’ failed with the following error:
Need to run the object to perform this operation
(Microsoft Data Transformation Services (DTS) Package (80040005):
Provider generated code execution exception:EXCEPTION_ACCESS_VIOLATION)The Access Violation occurs when these conditions are true:You use DTS package event handlers in the Visual Basic application.You use a parent DTS package that uses an Execute Package task to call a child DTS package.
Resolution
Threading limitations in the design of Visual Basic 6.0 prevent the nested child package from reporting it’s events up through the parent package’s event handler.

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.

BUG: WebClass Application with Japanese Templates May Fail

Symptoms
If a WebClass application uses templates that contain Japanese characters and runs on a system where the default language is Japanese, the WebClass application may fail under heavy load. When this occurs, the following entry (or similar) appears in the Application Event log:

WebClass Runtime (0×800A2328)
An internal exception has occurred NOTE: This error may occur for reasons other than the specific problem that is described in this article. To determine if you are experiencing this specific problem, attach a native code debugger such as Microsoft WinDBG to the process that hosts the WebClass application while it is running to catch the exception on first chance. The call stack should look similar to the following call stack:

0108cc0c 2764a744 0014fd76 00000159 OLEAUT32!SysAllocStringLen+0×7a0108cc24 2764a989 00000003 0014fd76 mswcrun!CTemplItem__SetItem+0×240108cc50 2764b122 00000003 0014fd76 mswcrun!CTemplItems__Add+0×1290108ccf8 2764bc2a 00154e48 03100000 mswcrun!CTemplateFile__ScanTemplate+0×2720108cd8c 27644e6f 00154e48 00110010 mswcrun!CTemplateFile__SendToClient+0×15a0108d02c 3b0c9c6c 00134b3c 00000008 mswcrun!CWebItem__WriteTemplate+0×21f Even if you do not have debug symbols available, the main indicator for this problem is that OLEAUT32 appears in the top stack frame, and MSWCRUN appears in a few stack frames below.
Resolution
This problem occurs because of a bug in the WebClass runtime. The problem may not be reproduced consistently. Although the problem has only been seen on a system in which Japanese is set as the default language and when WebClass applications use templates that contain characters with Shift_JIS encoding, the same problem may occur on systems that are configured for other bi-directional character sets and other character encodings.

BUG: Error message when you set the Width property of a Boolean DataGrid column to 1 in Visual Basic .NET or in Visual C# .NET: “System.ArgumentException”

Symptoms
You bind a DataGrid control to a data source that has a column with Boolean data. If you set the Width property of the DataGrid Boolean column to 1 at run time, you receive the following exception:

An unhandled exception of type ‘System.ArgumentException’ occurred in system.windows.forms.dll
Additional information: Invalid parameter used.
Resolution
To work around this bug, do not set the Width property of the DataGrid Boolean column to 1.

BUG: “Type System.IO.IOException” error message after you upgrade to Visual Basic .NET or Visual Basic 2005

Symptoms
After you upgrade your Microsoft Visual Basic 6 application to Visual Basic .NET or Visual Basic 2005, you may receive the following “exception” error message:

An unhandled exception of the type ‘System.IO.IOException’ occurred in microsoft.visualbasic.dll.
Resolution
This behavior occurs when all of the following conditions are true: The Visual Basic Upgrade Wizard upgrades Visual Basic 6 code that uses the Open statement to open a given file.
-and-You do not explicitly specify shared access to open this file.
-and-You attempt to open this file a second time without first closing it.NOTE: You may also receive this error message if you try to open a given file a second time (without closing the first file handle) by using the FileOpen function in Visual Basic .NET or in Visual Basic 2005 without specifying the Share argument.