Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Michel Levy
  Where is Michel Levy?
 
 France
 Michel Levy
 To: Binod Binani
  Where is Binod Binani?
 Kolkata
 India
 Binod Binani
 Tags
Subject: RE: SQL Transactions
Thread ID: 365203 Message ID: 365331 # Views: 48 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Monday, December 24, 2012 9:53:06 AM         
   


> >
> > --
> > Hi Binod,
> >
> > you are reaching the limits of the updatable remote data cursors, and you'll need soon to investigate the Sql Pass Through.
> > But for now, there's still a solution ;-)
> >
> > The transactions mode on server side are defined by VFP with the SQLSETPROP function with the parameter 'Transactions'. Default value is 1 (automatically handled), but you may set it to 2 (manually handled). In the manual way, you send a SQLCOMMIT() or a SQLROLLBACK() as needed by your code.
> >
> > Another way is to send explicitely to the SQL Server the commands for INSERT and UPDATE. You send it in a SQLEXEC. You may send as many commands as you want in a single SQLEXEC, each command separated by a semi-colon (;). Simply put a 'BEGIN TRANSACTION' as the first command. Don't forget to COMMIT or ROLLBACK in the same SQLEXEC. The local TABLEUPDATE or TABLEREVERT will depend on the result of the SQLEXEC.
> >
> > A third way (the best IMHO) should be to write some views on the server itself, and to build VFP remote vies on these SQL views. The views on the SQL Server will hold some TRIGGERs INSTEAD OF, which receive the commands send by the client (VFP or .net or whatever you develop in), the code you write for the triggers do the job in the transactions you define. All is done on server side, it is more reliable and faster.
> >
> > Michel L
>
> Thanx Sir Michel Levy.
>
> Very nice to have ur expert idea.
>
> It wud be great help for a sample on ur Third way.
> How to handle remote SQLviews in server.
>
> any web link might helpfull.
>
> Please
>
>
>
> *Exchange of $1 Create only $1, But Exchage of one Ideas Makes different two Ideas*

--
Hi,

2 contributions I wrote, on AtoutFox, with code sample inside:
http://www.atoutfox.org/articles.asp?ACTION=FCONSULTER&ID=0000000768
(how to update a SQLview with Triggers Instead Of)
http://www.atoutfox.org/articles.asp?ACTION=FCONSULTER&ID=0000000842
(CRUD on normalized data with SQLviews, Stored Procedures, and Triggers instead of)

both are in French, let me know if automatic translation is unreadable and feel free to ask for accuracy.


Michel L

ENTIRE THREAD

SQL Transactions Posted by Binod Binani @ 12/22/2012 6:04:21 AM
RE: SQL Transactions Posted by David Mustakim @ 12/22/2012 7:24:31 AM
RE: SQL Transactions Posted by Michel Levy @ 12/22/2012 1:09:08 PM
RE: SQL Transactions Posted by Binod Binani @ 12/24/2012 6:40:49 AM
RE: SQL Transactions Posted by Michel Levy @ 12/24/2012 9:53:06 AM
RE: SQL Transactions Posted by Anders Altberg @ 12/22/2012 1:52:03 PM
RE: SQL Transactions Posted by Michel Levy @ 12/22/2012 2:58:43 PM
RE: SQL Transactions Posted by Anders Altberg @ 12/22/2012 7:07:49 PM
RE: SQL Transactions Posted by Anil Sharma @ 12/24/2012 8:47:47 AM