Ralph (nt_consulting64@yahoo.com) writes:
[quoted text, click to view] > "Dan Guzman" <guzmanda@nospam-online.sbcglobal.net> wrote in message
> news:8F8F4E19-BD21-437F-9250-8CD1938DF88D@microsoft.com...
>> Be aware that ADO will implicitly open additional SQL connections as
>> needed so you need to make sure that resultsets are fully processed
>> before executing another command. Also, application roles and
>> connection pooling don't play nice together
>> (
http://msdn2.microsoft.com/en-us/library/8xx3tyca(VS.80).aspx).
>
> You're confusing ADO.Net behavior with ADO behavior. One has nothing to do
> with the other.
I'm not sure what you are talking about, but I know Dan, and Dan is
wrong far less often than I am.
In any case, old ADO can indeed do as Dan said: open a new connection
behind your back, which can cause various sorts of confusion. ADO .Net
will never do that as far as I know. If you try to run a command with
unfetched results, you will get an exception. (Unless MARS is involved.)
Dan's remark on application pooling is also on the target. The link happens
to be an ADO .Net resource, but the issue is the same in ADO.
There is, however, an error in the article Dan pointed to: "After a SQL
Server application role has been activated by calling the sp_setapprole
system stored procedure, the security context of that connection cannot be
reset." This is not true for SQL 2005, where you can back out of an
application role with sp_unsetapprole. This requires that you requested
a cookie when you set the role.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at