Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine if a transaction is still pending in SQ
Message
From
01/05/2007 10:46:44
 
 
To
01/05/2007 10:23:09
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01221475
Message ID:
01221491
Views:
21
I agree, but in this case, a begin is sent as soon as a change is made to a field on a form. There is a grid displaying a small result set and they want all edits to be within one single transaction to roll them all back if necessary. That part is working fine. The code to rollback or commit is in the form's queryunload method so if the form is exited by the button or the X, it rollsback the transaction or commits it. A form property is set to true when the BEGIN TRANSACTION is sent to the server successfully when the first (whichever it is) field is edited. I just want to check after the form is closed (or before it is destroyed) to see if there is a transaction pending in a more reliable means communicating with SQL Server rather than using the form property.



>>Connecting to SQLServer 2005, if a BEGIN TRANSACTION is sent to SQLServer, what is the safest way to determine if a ROLLBACK or COMMIT were or were not sent to end the transaction? If you send a COMMIT or ROLLBACK and no transaction is pending, you receive the SQL error...
>
>Imho, you shouldn't send them separately, i.e. you better call SP that contains both BEGIN and COMMIT.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform