Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT and Ado Transactions. VFP 6
Message
From
26/05/2004 10:34:08
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
26/05/2004 09:30:42
Suhas Hegde
Dental Surgeon
Sirsi, India
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00907319
Message ID:
00907358
Views:
11
>Hello Cetin,
>
>How do i accomplish the same in ADO. Preferrably with the command object.
>
>table1 -- table on sql server
>table2 -- table on sql server
>
>
>* han -- valid handle to SQLserver
>*SPT code
>set multilocks on
>cursorsetprop(0,"bufferring",5)
>
>sqlexec(han,"begin transaction")
>
>sqlexec(han,"select * from table1 with rowlock,updlock where table1_id = 'somevalue'","table1")
>sqlexec(han,"select * from table2 with rowlock,updlock where table2_id = 'somevalue'","table2")
>
>** make table1 and table2 updatable cursors
>** modify the records.
>
>if tableupdate(2,.t.,"table1") and tableupdate(2,.t.,"table2")
> sqlexec(han,"if @@trancount > 0 Commit")
>else
> aerror(ernoupdates)
> sqlexec(han,"if @@trancount > 0 Rollback")
> tablerevert("table1")
> tablerevert("table2")
>endif
>
>
>TIA
>suhashegde

Hi Suhas,
I don't have out of the box ready code but should be something like :

oConn.Isolation = isolatedconstant
...
oRS.LockType = pessimisticconstant
oRS.CursorType = dynamicconstant
oConn.BeginTrans
...
oConn.Rollbacktrans or oConn.Endtransaction


PS:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q198/0/24.ASP&NoWebContent=1
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform