Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to rollback table update change via CA.
Message
From
09/02/2004 00:01:19
James Chan
Objectmastery Pty Ltd
Hawthorn, Australia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How to rollback table update change via CA.
Miscellaneous
Thread ID:
00875339
Message ID:
00875339
Views:
48
I use CursorAdapter to connect to an SQLServer table. I can insert records to the SQLServer table via CA. But how do I rollback the changes in the SQLServer table? Or is it better to control the commit/rollback in SQLServer?

I've tried using "begin transaction", "rollback", "tableupdate()" and "tablerevert()", (see below). The CA is reverted OK, but the SQLServer table is not.

Thanks
James


set multilocks on

locursor = createobject('SQLAdapter')

with loCursor

if .cursorfill(.f., .t.)

begin transaction

insert into Transact values ('IS00000005', 'JC ')
insert into Transact values ('IS00000006', 'JC ')

browse

= tableupdate(1)

rollback

browse

=TABLEREVERT(.t.)

brow

else

* dimension laErros[1]
aerror(laErrors)
messagebox(laErrors[2])

endif

endwith
James Chan
ObjectMastery Pty Ltd
Next
Reply
Map
View

Click here to load this message in the networking platform