>Working with VisualFoxPro 5.0 I'm having trouble with this code:
>
>sqlexec( n, 'begin transaction' )
>select(1)
>tableupdate(.t.)
>select(2)
>tableupdate(.t.)
>sqlexec( n, 'commit transaction' )
>
>The problem is that seems to don't work ok the sqlserver transaction scheme because the commit rollback that works ok with one tableupdate creates rare behaviour with two or more tableupdates.
>
>Can you help me? Please?
>
>Thank you very much.
>Ricardo.
Hi Ricardo,
I have faced same problem and here is the solution.
When we connect with SQLCONNECT() we get unique connection handle. Each connection has AutoTransaction property (can be 1 or 2) which contains 1
by default. so whenever you issue TABLEUPDATE() it ends (commits) transaction on backend.
You can turn this off by issuing
SQLSETPROP(nHandle, "Transactions", 2)
See help of SQLSETPROP().
Bye
Jayesh
- Jayesh