Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Frank Cazabon
  Where is Frank Cazabon?
 
 Trinidad And Tobago
 Frank Cazabon
 To: Binod Binani
  Where is Binod Binani?
 Kolkata
 India
 Binod Binani
 Tags
Subject: RE: Totals in Buffer Mode
Thread ID: 112549 Message ID: 112550 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Grids
Date: Thursday, November 09, 2006 3:23:17 PM         
   


Hi Binod,

by default SELECT-SQL works on the actual data in the table, not what is in the buffered cursor, as you have found out. There are a few workarounds possible:

1. If using VFP9 check out the WITH BUFFERING clause of the SELECT - SQL command.

2. Don't use SELECT-SQL, loop through your cursor and get your totals (you could possibly use SUM TO myTotal command).

3. Start a transaction, commit the changes, get your total using SELECT-SQL, then rollback transaction.



> Hello experts
>
> Mytable.dbf having Dates,Qnty (n,6) fields.
> In Entry form in i am using Mytable in buffer mode 5.
>
> I am using grid1 & pupulated with mytable
>
> On clicking "ADD" command-button I am adding new blank
> record in grid and & user can put certain numering data as quantity.
>
> User goes on adding few records and At certain point user
> may have total of Quantity fields which he have enterd.
>
> for this I am using :
>
> Select sum(qnty) into array myarray from mytable
>
> but it shows total of all Qnty in the file (not of current records
> which yet not saved from buffer to table )
>
> whats wrong????
> is there any better way????
>
> Please help
>
>
>
>
> new to vfp




Frank.

Frank Cazabon
Samaan Systems Ltd.
www.SamaanSystems.com/

ENTIRE THREAD

Totals in Buffer Mode Posted by Binod Binani @ 11/9/2006 3:14:44 PM
RE: Totals in Buffer Mode Posted by Frank Cazabon @ 11/9/2006 3:23:17 PM
RE: Totals in Buffer Mode Posted by Borislav Borissov @ 11/9/2006 3:24:06 PM
RE: Totals in Buffer Mode Posted by Ken Murphy @ 11/9/2006 4:30:07 PM
RE: Totals in Buffer Mode Posted by Borislav Borissov @ 11/9/2006 6:58:51 PM
RE: Totals in Buffer Mode Posted by Ken Murphy @ 11/9/2006 9:04:48 PM
RE: Totals in Buffer Mode Posted by Ken Murphy @ 11/9/2006 4:36:39 PM