Re: Error msg
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Thu, 10 Nov 2005 22:40:58 +0000 (UTC)
Roy (Roy@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
> I use OLE DB to call a series of stored procedures to add records to
> database tables within one transaction. I got the following errors:
>
> Description: Cannot create new connection because in manual or distributed
> transaction mode.
> Source Description: Microsoft OLE DB Provider for SQL Server
>
> The stored procedures are very simple. I do not try to create a new
> connection explicitly. Neither do I try to use distributed transactions.
> The only thing that might be a little complicate is I use
> ISequentialStream to write blobs to table fields. The error msg confuses
> me. Any one has ideas about this?
This sound like something that happens because you have not retrieved
all data from a result set, before you initiate a new connection. With
some APIs thies leads to an immediate error that the connection is busy.
OLE DB's default behaviour is instead to open a second connection
behind your back. Which apparently does not succeed here.
You can prevent OLE DB to open extra connection by setting the data-
source property DBPROP_MULTICONNECTIONS to FALSE.
But the root of the problem is the unconsumed result sets. A common
gotcha here are the rowcount messages from UPDATE, INSERT and DELETE
statement. These you can turn off with SET NOCOUNT ON.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
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
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Prev by Date: Re: Using Visual FoxPro indexes from Visual Basic .Net
- Next by Date: Re: Error msg
- Previous by thread: Re: Using Visual FoxPro indexes from Visual Basic .Net
- Next by thread: Re: Error msg
- Index(es):
Relevant Pages
|
Loading