Tengo problemas con el uso de oDbf:modified()
¿Es posible que odbf:Modified() (ni oDbf:Updated() en su caso) no pase a .F. aún después de realizar oDbf:save() seguido de su correspondiente oDbf:Commit()?
Saludos
Tengo problemas con el uso de oDbf:modified()
¿Es posible que odbf:Modified() (ni oDbf:Updated() en su caso) no pase a .F. aún después de realizar oDbf:save() seguido de su correspondiente oDbf:Commit()?
Saludos
Thanks for pointing this out.
Method Save() should have called ::Load().
We shall fix this in next version.
For now, please use this workaround:
After calling oDbf:Save(), please call oDbf:Load()
Then I should wait until your next release. It is impossible for me to do it that way since I have my own Scatter and Gather beside (and above) those provided by Odbf and it will be a nightmare to reload data and gather in my 230 variables anew (has to do with Dbase field limitations and I was forced to use memo fields to subdivide them in several ones for the problem at hand like in the good all days in assembler). ![]()
I suppose you are using FWH13.05
For scatter/gather FWH provides two alternatives.
TDatabase class:
For the problem you pointed out in this post we have two alternatives.
(a) Call oDbf:Load() after calling oDbf:Save()
OR
(b) Make this modification in database.prg and link with your project.
Please go to line no 1049 in method Save()
Between "endif" in line 1049 and next "endif" in line 1050 insert a line
::Load()
TDataRow() class.
You may use normal DBFs
Instead of legacy scatter/gather functions
oRec := TDataRow():New( <cAlias> )
You can refer to fields of the DBF like
? oRec:<fieldname>
oRec:<fieldname> := NewVaue
You can also create dialogs with @ r,c GET oRec:Amount PICTURE ....
When finished you can all'
oRec:Save()
This will save the modified data in the same record.
Example:
USE CUSTOMER NEW SHARED ALIAS CUST
SKIP 10
oRec := TDataRow():New( "CUST" )
? oRec:Age
oRec:Age := 50
? oRec:Modified()
oRec:Save()
There is also a default simple edit dialog
oRec:Edit()
Thanks for your prompt and extensive response. I suppose you mean between lines 1046 and 1047 (2 consecutive ENDIFs of method save() class Tdatabase)
Will try.
yes