Hi Fabio
Thank you for your reply. I thought of using Visual FoxPro 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 Visual FoxPro DATABASE involved. So how then can I use Visual FoxPro 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.
Documentation is incorrect.
Only local cursor not support Transactions.
Cursors builded with a local View, ODBC View and ADO View ( this last not tested )
support transaction with none dbc
CLOSE DATABASES all
h=SQLCONNECT("NorthWind")
SQLEXEC(h,"SELECT*FROM dbo.Categories","cat")
SQLDISCONNECT(m.h)
BEGIN TRANSACTION
? CategoryId
REPLACE CategoryId WITH -CategoryId
? CategoryId
ROLLBACK
? CategoryId
USE
Also is there any workaround for the SQLSETPROP(oConn,"Transactions",2) "Bug" you mention?
read thread #
819734 messages #820721 #820794
use
SQLSETPROP(oConn,"Transactions",1)
SQLEXEC(h,"BEGIN TRAN")
SQLEXEC(h,"IF @@TRANCOUNT>0 COMMIT") or SQLEXEC(h,"WHILE @@TRANCOUNT>0 COMMIT")
SQLEXEC(h,"IF @@TRANCOUNT ROLLBACK")
Fabio