Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering
Message
 
À
01/02/2007 14:51:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01191514
Message ID:
01191578
Vues:
12
>>>>>I have a form with 5 tables in the dataenvironment. The buffermodeoverride is set to 1 for all of the tables.
>>>>>
>>>>>The form's init contains:
>>>>>
>>>>>set multilocks on
>>>>>= CURSORSETPROP('Buffering',5, 'biditems' )  && Enable row buffering.
>>>>>= CURSORSETPROP('Buffering',5, 'projects' )  && Enable row buffering.
>>>>>= CURSORSETPROP('Buffering',5, 'projectphases' )  && Enable row buffering.
>>>>>= CURSORSETPROP('Buffering',5, 'lineitemspecs' )  && Enable row buffering.
>>>>>dodefault()
>>>>>
>>>>>The form's buffermode = 2
>>>>>
>>>>>The form has a pageframe and the pageframe contains a grid.
>>>>>The grid's recordsource is set
>>>>>
>>>>>thisform.df_tabs1.df_page1.grdBiditems.RecordSource = ;
>>>>>"select * from biditems " + ;
>>>>>"	inner join lineitemspecs " + ;
>>>>>"	on biditems.lineitemid = lineitemspecs.lineitemid " + ;
>>>>>"	where biditems.projectphaseid = val(this.value) " + ;
>>>>>"	into cursor crsTemp readwrite"
>>>>>
>>>>>The grid's AfterRowColChange contains
>>>>>LPARAMETERS nColIndex
>>>>>
>>>>>=tableupdate(0,.t.,"biditems")
>>>>>
>>>>>
>>>>>It all seems to work except the edits made in the grid are not being saved back to the biditems table. What am I missing?
>>>>
>>>>First, Buffering = 5 is not ROW buffering. It is optimistic Table buffering.
>>>>Second, you miss to check WHY TableUpdate is not successful:
>>>>
>>>>IF NOT tableupdate(0,.t.,"biditems")
>>>>   AERROR(laError)
>>>>   MessageBox(laError[1,2])
>>>>ENDIF
>>>>
>>>
>>>I know, I originally had it set to 3 and then changed it to 5. I just haven't cleaned up my comments yet (I want to get it working first) shame on me.
>>>
>>>Your suggested code does not produce an error. A browse of the cursor shows the values in the cursor but they are not getting to the original table.
>>
>>
>>OOOOOO, Shame on me! I just watch buffering code and TableUpdate() one. Not see that your grid RecordSource is not BidItems table.
>>OK, What version of VFP?
>
>Using VFP 9.
>Note that the reason for the SELECT in the record source of the grid is that it is dynamic. That is: the recordsource is determined by the values the user chooses in other controls on the form. In this case a series of combos which choose values from the other tables.
>

>Ed - So the difference between a local view and the query is all the dbsetprop code?

Yes :-)

But I prefer to use CursorAdapter. And when you add a parameter to it you only need it to CursorRefresh() it where that/these parameter(s) change.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform