Hi!
Are you sure "VPREDIOS", "VHISCRED", "VRECIBOS" and "VDRECIBOS" use the same connection handle? Try to get it by CursorGetProp("ConnectHandle","VPREDIOS") and see if it matches to the connobj.handle.
From what I know, it is better to run "BEGIN TRANSACTION" command using SQLEXEC(), then appropriate T-SQL commands to finish it ("COMMIT TRANSACTION" or "ROLLBACK TRANSACTION").
HTH.
>Actually we are developing a SQL application with a VFP Front End. In this application I use both remote views and SQL pass trough (SPT). To use SPT I develop a object named CONNOBJ that execute instructions, scripts, etc. I observe all the system works fine except for the manual transactions. I have a form using 4 remote views and I want to save to SQL server but using transactions. This is my code:
>
>If sqlsetprop ( connobj.handle, “TRANSACTIONS”, 2 ) then
> If tableupdate ( 2, .f., “VPREDIOS” ) then
> If tableupdate ( 2, .f., “VHISCRED” ) then
> Wait “Transaction Tests “ window
> If tableupdate ( 2, .f., “VRECIBOS” ) then
> If tableupdate ( 2, .f., “VDRECIBOS” ) then
> * commit transactions
> connobj.commit
> else
> * rollback transactions
> connobj.rollback
> endif
> else
> connobj.rollback
> endif
> else
> connobj.rollback
> endif
> else
> connobj.rollback
> endif
>else
> connobj.rollback
>endif
>sqlsetprop ( connobj.handle, “TRANSACTIONS”, 1 )
>
>I test my CONNSQL object outside of my program and the transactions works fine !!!. But when use in my form don’t work!!!. I try SQLSETPROP ( 0, …. ) and DBSETPROP() but still don´t work. For testing I disconnect my PC from the network between the TABLEUPDATE() instructions and I observe that SQL SERVER update my first tables without receiving the SQLCOMMIT.
>
>Any Suggestions???
>
>Sincerely and sorry for my bad english
>
>Ing. Edmundo Rios Miranda
>Estrategias Computacionales, SA de CV
>Cuernavaca, Morelos, México
>
Escom@infosel.net.mx
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.