Microsoft KB Archive/193865

{|
 * width="100%"|

PRB: Info Message Not Appended to ADO Errors Collection

 * }

ID: Q193865

-

The information in this article applies to:


 * ActiveX Data Objects (ADO), versions 2.0, 2.1 SP2, 2.5, 2.6

-

SYMPTOMS
The InfoMessage event of the connection object in ActiveX Data Objects (ADO) fires only when there is at least one Informational Message that resulted while establishing a connection to a database server. When opening an Asynchronous ADO connection, even if an InfoMessage event fires, no errors are appended to the Errors collection. In other words, the Errors collection is empty although there are one or more Info messages. If you open a synchronous connection, all Info Messages are appended to the Errors collection.

STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION
ADO versions prior to 2.0 did not support events. Starting with ADO 2.0, Connection and Recordset objects have events associated with them. While establishing a connection to most database servers, the ODBC driver returns one or more Informational messages. These messages generally have a lower error severity level (usually below 10).

The following sample code establishes a connection to SQL Server Synchronously and Asynchronously using Visual Basic code. The Errors collection shows two Info Messages for Synchronous connection while it shows none for an Asynchronous connection.

Steps to Reproduce Behavior

 * 1) Start standard project in Visual Basic 6.0.
 * 2) Add a reference to the Microsoft ActiveX Data Objects 2.0 Library.
 * 3) Add one command button to the default form.
 * 4) Paste the following code in the form:
 * 5) Modify the connection string to match your server settings.
 * 6) Run the project. Note that the informational messages display in a message box followed by a "Connection is established" message.
 * 7) Uncomment the commented section of the Cn.Open line.
 * 8) Run the project again and note that the following error occurs:

(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Hussain Abuthuraya, Microsoft Corporation.

Additional query words:

Keywords : kbdta kbADO200 kbADO200bug kbADO210bug kbDatabase kbGrpVBDB kbGrpMDAC kbDSupport kbADO210sp2 kbMDAC250 kbADO250 kbMDAC260 kbADO260

Version : :2.0,2.1 SP2,2.5,2.6

Platform :

Issue type : kbprb

Technology :