Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CursorAdapters and Transactions in SQLServer
Message
From
26/05/2004 08:31:17
 
 
To
26/05/2004 05:30:02
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00907176
Message ID:
00907286
Views:
12
Hi Fabio

Thank you for your reply. I thought of using VFP transactions till I read the VFP8 Help file on TRANSACTIONS:

Begins a transaction.
Transactions are supported only for tables in a database. See CREATE DATABASE and ADD TABLE for information on how to create and add tables to a database.

Since I am using CursorAdapters, there is no VFP DATABASE involved. So how then can I use VFP Begin Tran - Rollback - End Tran commands. This will work with views that are in a database but one of the benefits touted about CA's is that they dont need a database.

Also is there any workaround for the SQLSETPROP(oConn,"Transactions",2) "Bug" you mention?



>
>* set transactions on
>SQLSETPROP(oConn,"Transactions",2) && ATTENTION, this have a bug, if a transaction is open a disconnect do a commit
>BEGIN TRAN
>DO CASE
> CASE NOT ThisForm.SaveData()
>   SQLROLLBACK(oConn) && IF THIS FAIL ? what do you do ?
>   ROLLBACK
> CASE SQLCOMMIT(oConn) < 0
>   AERROR(aer)
>   MESSAGEBOX(aer[2])
>   SQLROLLBACK(oConn)
>   ROLLBACK
> OTHERWISE
>   END TRAN
>   WAIT WINDOW NOWAIT "Data has been updated"
>ENDCASE
>* set transactions off
>SQLSETPROP(oConn,"Transactions",1)  && ATTENTION, if a transaction is open this do a commit
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform