Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Buffering and Tableupdate()
Message
 
To
13/04/2006 13:30:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01113462
Message ID:
01113533
Views:
17
>>
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform