• If you are trying to get the "meassages" output from a SQL statement or procedure executed through ADO (version 2.5 or later), you can use the ADODB.Recordset.NextRecordset() to get to the next recordset. However, it depends on what provider you are using for your connection that determines what exactly the "next recordset" is. If you are using the OLE DB Provider for SQL Server, the next recordset will indeed be the "messages" part of the return. This will usually be the "3 records affected" string, but can be warnings, or DBCC messages, for instance.

    To be honest, I would highly NOT RECOMMEND using this approach because it is dependent upon the provider to determine what exactly is the next recordset, so your code may break if trying to be provider-agnostic. The only reason I even know about this is because I had to debug a really nasty error resulting from the OLE DB provider interpreting a message result as an actual recordset.

    If you just want to retrieve the count of records affected, the best methods are to use the ADODB.Recordset.RecordCount function, or pass in (by reference) an argument into the ADODB.Command.Execute function which allows a referenced parameter to be filled with the number of recorsd affected.

    For more information on this behavior, see the following page in MSDN:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdamth02_16.asp