I have some code that I have been using for years to return the results of a SQL Server (2005) query into an ADO recordset. With one such query I am getting the message:
Once I eliminate the source of the warning messages by adjusting the data, the VB code works fine. Is there a way I can get the logic to ignore these error messages and return the recordset anyway? Or something I can do in the query to switch off the warnings (like I might do with SET NOCOUNT ON)?
when I attempt to reference the RecordCount property of the recordset. When I run the query in management studio, it returns 9 records but, on further investigation, I realise that the query generates 2 identical warning messages:Operation is not allowed when object is closed
Warning: Null value is eliminated by an aggregate or other SET operation.
Once I eliminate the source of the warning messages by adjusting the data, the VB code works fine. Is there a way I can get the logic to ignore these error messages and return the recordset anyway? Or something I can do in the query to switch off the warnings (like I might do with SET NOCOUNT ON)?