BUG: An exception occurs in the ActiveX Data Objects library when you execute a query a second time in a Visual Basic .NET application (832947)
The information in this article applies to:
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Academic Edition
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 You receive unexpected errors when using ADO and ADO MD in a .NET Framework application SYMPTOMSWhen you execute a query from a Microsoft Visual Basic .NET
application a second time, the Microsoft ActiveX Data Objects Library (ADODB)
throws an exception, and you receive the following error message: An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in
microsoft.visualbasic.dll Additional information: Syntax error or access
violation WORKAROUNDTo work around this problem, use an early bound expression.
To do this, locate the following code in step 6 of the "More Information"
section of this article. cn.QueryCustomers(intDisc, rs) '==>> exception here
rs.ActiveConnection = Nothing Replace this code with the following code. rs = cmd.Execute(, New Object() {intDisc}) STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed in the "Applies to" section of this
article.REFERENCES For additional information, click the following article number
to view the article in the Microsoft Knowledge Base: 301075
HOW TO: Connect to a Database and Run a Command by Using ADO.NET and Visual Basic .NET
Modification Type: | Major | Last Reviewed: | 6/15/2006 |
---|
Keywords: | kbvs2002sp1sweep kbMessageBox kbExceptHandling kbCOMInterop kbbug KB832947 kbAudDeveloper |
---|
|