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

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  && 1
REPLACE CategoryId WITH -CategoryId
? CategoryId && -1
ROLLBACK
? CategoryId && 1
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform