Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering and Tableupdate()
Message
 
À
13/04/2006 13:30:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01113462
Message ID:
01113534
Vues:
14
Of course, I forgot to put KeyField in UpdateNameList :o(, here a working example:
CREATE TABLE Test_financing (Tip_Id I, amount N(12,2), source C(20), year I, phase C(1))
FOR asd = 1 TO 20
    INSERT INTO Test_financing VALUES (asd, asd*12.73,REPLICATE([a],MIN(asd,20)),2007, [A])
NEXT
GO TOP
BROWSE 

CLOSE DATABASES ALL

oCA = CREATEOBJECT([CursorAdapter])
TEXT TO oCa.SelectCmd PRETEXT 15 NOSHOW
     SELECT Test_financing.tip_id, Test_financing.amount,
            Test_financing.source, Test_financing.year, Test_financing.phase
            FROM TEST_FINANCING.DBF
            WHERE  Test_financing.year = ( ?m.lnYear )
    ORDER BY Test_financing.tip_id
ENDTEXT
oCa.BufferModeOverride = 5
oCa.DataSourceType = [NATIVE]
oCa.SendUpdates    = .t.
oCa.WhereType      = 1
oCa.Tables         = [Test_financing]
oCa.FetchSize      = -1
oCa.KeyFieldList   = [Tip_ID]
oCa.UpdateNameList = "Amount Test_financing.Amount, Source Test_financing.Source,"+;
                     "year   Test_financing.year  , phase  Test_financing.phase,"+;
                     "Tip_ID Test_financing.Tip_ID"
oCa.UpdatableFieldList = "Amount, Source, year, phase"
oCa.Alias              = [crsTest]

m.lnYear = 2007
oCa.CursorFill()
GO TOP
REPLACE Amount WITH 100
IF NOT TableUpdate(1, .t., [crsTest])
   AERROR(aaa)
   MESSAGEBOX(aaa[1,2])
ENDIF
BROWSE
SELECT Test_financing
GO TOP
BROWSE 
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