Re: Retrieving errors OLEDB-MDAC
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Tue, 12 May 2009 15:20:05 -0500
"Ivo" <Ivo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:57CD653E-A065-42FF-A88D-149951BF691A@xxxxxxxxxxxxxxxx
We have a VB6 Application using ADO (mdac2.8) to connect to SQL 2005. WeNow
connect to database using:
Provider=MSDASQL.1 and CursorLocation= adUseClient.
This connection is working fine, but tracing with the profiler we found a
lot of instruction like: 'exec sp_cursorfetch'
So we changed the provider to SQLOLEDB and kept the same CursorLocation.
the profiler doesn't show the 'sp_cursorfetch' entries. OK but, now we can't
retrieve our print statements from within the triggers and storedprocedures
through the ADODB.Conection.Errors collection.just
Changing the CursorLocation to adUseServer resolves the problem but is
not what we want.
So, why can't we retrieve Print Statements with SQLOLEDB?
You can, just a tad differently.
They are two very different providers (MSDASQL is a deprecated "OLE DB for
ODBC", SQLOLEDB is a 'pure' OLE DB Provider), and how "returns" are handled
are very different.
In general, with ADO/OLE DB/ODBC the only "return" available was the Errors
Collection - and that's what the MSDASQL provider populated with some degree
of reliability. With SQLOLEDB you do have "returns" - so you want
something - ask for it.
[SET NOCOUNT ON wil]
You mentioned retrieving "errors", then retrieving "Print". You will likely
need a different scheme (rewriting the SP?) for retrieving both, so it is
difficult to give a definitive answer. This might help:
"Error Handling in SQL Server - a Background"
(or as I like to call it "More than you will ever want to know about Error
Handling in SQL Server")
http://www.sommarskog.se/error-handling-I.html
It also suggests some other links.
Plus provides the buzz words for additional searches.
hth
-ralph
.
- Follow-Ups:
- Re: Retrieving errors OLEDB-MDAC
- From: Ivo
- Re: Retrieving errors OLEDB-MDAC
- References:
- Retrieving errors OLEDB-MDAC
- From: Ivo
- Retrieving errors OLEDB-MDAC
- Prev by Date: Re: How to execute this parameter query?
- Next by Date: Re: DataSet not seeing results from two stored procedures
- Previous by thread: Retrieving errors OLEDB-MDAC
- Next by thread: Re: Retrieving errors OLEDB-MDAC
- Index(es):
Relevant Pages
|