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:
01113533
Vues:
16
>>
>>As I said you can use CA, Nost so many lines :o)
>>The same View definition, rewroted to CA will looks like this:
>>
>>
>>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 Z:\DFREEMAN\TIP\DATA\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.KeyFields      = [Tip_ID]
>>oCa.UpdateNameList = "Amount Test_financing.Amount, Source Test_financing.Source,"+;
>>                     "year   Test_financing.year  , phase  Test_financing.phase"
>>oCa.UpdatableFieldList = "Amount, Source, year, phase"
>>oCa.Alias              = [crsTest]
>>
>>m.lnYear = 2007
>>oCa.CursorFill()
>>REPLACE Ammount WITH 100
>>TableUpdate(1, .t., [crsTest])
>>
>>
>>Of course in this example there is no error handling :o)
>
>Borislav -
>This does look like it will be simpler. The code you provided runs OK (I had to change KeyFields to KeyFieldsList) but the revised data is not saved to the original table. I tried specifying the original table in the TableUpdate command but this produced an error. Is there a tweak needed here?
>
>- Don

I wrote this directly here, so maybe there some syntax errors and omiistion, let me check it again :o)
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
Répondre
Fil
Voir

Click here to load this message in the networking platform