How do I use ADO transaction blocks correctly ?
"H KO" <[email protected]>
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <[email protected]> |
Hi everyone, I'm running into a problem I've seen before but I still don't know the best way of solving it. I'm using Delphi 7 / SQL Server 2000 with the ADO (SDAC) components and when I start a transaction on a ADO connection and I try to Open a recordset using a stored proc or Post changes to a recordset I get "Cannot create new connection because in manual of distributed transaction mode." I know the underlying problem is that SQL Server internally tries to implicitly create a new connection for my command. But how do I work around this ? I'm using 6 stored procs, resulting in 6 recordsets (cursorType = ctDefaultResultSet, former name Firehose) which I want to modify separately. Changes to these recordsets I want to post within the transactionblock in order to get the new ID values of identity fields. Weird enough everything works fine using 3 of the SP's together, changing and posting their recordsets, but using one or more of the other SP's directly results in the error mentioned above. I also checked the state of all recordsets linked to the connection the transaction block is on and they are all in dsBrowse state (also UpdatesPending for all recordsets is false) so why does the server needs to open a new connection for my command anyway ? Plz tell me there is a structured way around this problem because I've tried alot (including other cursortypes which keep getting downgraded by the server). Thanks in advance for any help, Erik Koffijberg. _________________________________________________________________ MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl ------------------------ Yahoo! Groups Sponsor ---------------------~--> Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more. http://www.c1tracking.com/l.asp?cid=5510 http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/i7folB/TM ---------------------------------------------------------------------~-> CodeCoffer - new Delphi code protection Tool! http://www.delphicollection.com/public/CodeCoffer.htm --------------------------------------------------------------- Unsubscribe:[email protected] List owner:[email protected] --------------------------------------------------------------- Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/