Hi all,I run in to this very annoying behaviour in ADO (used in ASP in this case).If I run a procedure that is supposed to return a resultsets and the procedure raises an error after the resultset is returned, ADO does not trap the error...try this code:SQL:CREATE PROCEDURE [dbo].[sp_error]AS /* IF THIS LINE IS HERE, ERROR DO NOT SHOW UP IN ADO */ SELECT 'test' AS value RAISERROR ('this is an error', 16, 1) RETURN
ASP: dim oConn Set oConn = Server.CreateObject("ADODB.Connection") oConn.ConnectionString = ConnString oConn.CommandTimeout = 180 oConn.Open Set oRS = Server.CreateObject("ADODB.recordset") oRS.activeconnection = oConn oRS.cursortype = 3 oRS.locktype = 4 oRS.CursorLocation = 3 oRS.source = "EXEC test.dbo.sp_error" oRS.open oRS.close oConn.close SET oRS = Nothing SET oConn = Nothing
Anybody find a good way of dealing with this... preferably on the ADO side?Thanks!