Article ID: 308499 - Last Review: November 28, 2007 - Revision: 3.2 PRB: Unhandled Exception When You Set ADO Property to a String in Visual Basic .NETThis article was previously published under Q308499 For a Microsoft Visual C# .NET version of this article, see 309047
(http://support.microsoft.com/kb/309047/EN-US/
)
.
Caution ADO and ADO MD have not been fully tested in a Microsoft .NET Framework environment. They may cause intermittent issues, especially in service-based applications or in multithreaded applications. The techniques that are discussed in this article should only be used as a temporary measure during migration to ADO.NET. You should only use these techniques after you have conducted complete testing to make sure that there are no compatibility issues. Any issues that are caused by using ADO or ADO MD in this manner are unsupported. For more information, see the following article in the Microsoft Knowledge Base: 840667
(http://support.microsoft.com/kb/840667/
)
You receive unexpected errors when using ADO and ADO MD in a .NET Framework application On This PageSYMPTOMS
When you set a property value on an ActiveX Data Objects (ADO) object to a string value, you may encounter the following exception:
Unhandled Exception: System.Runtime.InteropServices.COMException (0x800A0BB9): Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
CAUSE
When you use ADO in the Microsoft .NET Framework with Component Object Model (COM) interop, ADO properties that formerly accepted either object references or string values now only support object references. As a result, when you try to set a property to a string value, an exception is thrown.
RESOLUTION
To set an ADO property that accepts either an object or a string to a string value in the .NET Framework, use the let_ methods that COM interop generates for imported assemblies. For sample code that demonstrates this, refer to the "More Information" section.
MORE INFORMATIONSteps to Reproduce the Behavior
| Article Translations
|
Back to the top
