On Sat, May 14, 2011 at 10:46 AM, Rafael Copquin <[email protected]> wrote:
> I do not understand you. Please explain further.
-------------------
if lOK
sqlexec(nHandle,'IF @@TRANCOUNT > 0 COMMIT')
else
sqlexec(nHandle,'IF @@TRANCOUNT > 0 ROLLBACK')
endif
Your process I commented above is fine for runnining within the VFP
engine but these are disconnected statements in SQL Server and SQL has
no idea of your starting point to rollback from.
EACH sqlexec() is a complete statement. You are grouping them
together and expecting them to operate as your VFP program. That will
not happen..
Only way to do this is to send ALL the code in one larger statement to
SQL Server and have it be responsible for the transaction instead of
thinking that VFP can send the proper command to SQL Server that will
be appropriate.
the prg you have in VFP would be considered a SP if you wrote it to
run there. You call the procedure with the necessary parameters and
it will act just like you can make VFP do it. This is what I would
recommend.
--
Stephen Russell
Unified Health Services
60 Germantown Court
Suite 220
Cordova, TN 38018
Telephone: 888.510.2667
901.246-0159 cell
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.