In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

To Ignacio sample modified to see the Dataset problems

Xailer English public forum
Responder
Avatar de Usuario
Dionisis Divaris
Mensajes: 485
Registrado: Jue Jul 12, 2007 8:48 pm
Ubicación: Athens Greece

To Ignacio sample modified to see the Dataset problems

Mensaje por Dionisis Divaris »

Hello Ignacio
In this post you find a modified demo, please compile it with both versions
March 2009 and June 2009 and press the button simulate problem.
I wait your conclusions.
TIA
Dionisis


Attached files DBFData7.zip (5.5 KB)Â
T.I.A
Dionisis
SGS-soft
support.sgs@gmail.com
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9447
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

To Ignacio sample modified to see the Dataset problems

Mensaje por ignacio »

Dionisis,
I alreay knew the problem as I told you, but I believe is fixed now without
too much speed penalty.
The problem arises when you change by code a field that is already linked to
a datacontrol, because on the Update method of the Dataset the value of the
datacontrol is written to the field destroying any previous change made by
you.
With the new code that we will publish in a few days (just to see if
something else arises) the method Fieldput() informs to its linked
datacontrol that the value of the field has changed. This does not happen
whith FastAddNew and FastEdit methods.
BTW, your sample has a lot of incongruences that I will like to comment:
METHOD PushToChange( oSender ) CLASS TForm2
DO CAsE
CASE ::oFirst:lModify
MsgAlert("First Field Changed, must saved.")
IF !::oParent:oRs:Edit()
MsgStop("Parent Dataset not going into Edit")
::Close()
ELSE
MsgInfo("Changed Values Must Now Writen Back")
::oParent:oRs:First:= ::oFirst:value
::oParent:oRs:Update()
::Close()
Endif
CASE ::oLast:lModify
MsgAlert("Last Field Changed, must saved.")
IF !::oParent:oRs:Edit()
MsgStop("Parent Dataset not going into Edit")
::Close()
ELSE
MsgInfo("Changed Values Must Now Writen Back")
::oParent:oRS:RecLock() // Unnecessary
::oParent:oRs:FieldPut(2,::oLast:value)
*::oParent:oRs:Commit() // Unnecessary
::oParent:oRs:Refresh() // Unnecessary
::oParent:oRS:UpdateControls() // Unnecessary
::oParent:oRs:FilUnlock() // Unnecessary
::oPArent:ORS:CANCEL() // WRONG, it should be UPDATE()
::Close()
Endif
CASE ::oStreet:lModify
MsgAlert("STREET Field Changed, must saved.")
IF !::oParent:oRs:Edit()
MsgStop("Parent Dataset not going into Edit")
::Close()
ELSE
MsgInfo("Changed Values Must Now Writen Back")
::oParent:oRS:RecLock() // Unnecessary
::oParent:oRs:aFields[03]:Value:= ::oStreet:Value
::oParent:oRs:Refresh() // Unnecessary
::oParent:oRs:UpDateControls() // Unnecessary
::oParent:oDBBrowse1:RefreshCurrent() // Unnecessary
::oParent:oRs:FilUnlock() // Unnecessary
::oParent:oRs:CANCEL() // WRONG, it should be UPDATE()
::Close()
Endif
Otherwise
MsgInfo("No Changes form closes.")
::Close()
ENDCASE
RETURN Nil
--
Ignacio Ortiz de Zúñiga
Xailer support / Soporte de Xailer
http://www.xailer.com
http://www.xailer.info
"Dionisis Divaris" <info@sgs-soft.gr> escribió en el mensaje
news:4a410002$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Hello Ignacio
>
> In this post you find a modified demo, please compile it with both
> versions March 2009 and June 2009 and press the button simulate problem.
>
> I wait your conclusions.
>
> TIA
> Dionisis
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
Dionisis Divaris
Mensajes: 485
Registrado: Jue Jul 12, 2007 8:48 pm
Ubicación: Athens Greece

To Ignacio sample modified to see the Dataset problems

Mensaje por Dionisis Divaris »

Hello Ignacio
Many thanks for the info, i will waiting until new relaease. So i use
March version for production scedules.
Again Best Begards ang Many Thanks
Dionisis
"Ignacio Ortiz de Zúñiga" <NoNameToAvoidSpam@xailer.com> wrote in message
news:4a4209eb$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
> Dionisis,
>
> I alreay knew the problem as I told you, but I believe is fixed now
> without too much speed penalty.
>
> The problem arises when you change by code a field that is already linked
> to a datacontrol, because on the Update method of the Dataset the value of
> the datacontrol is written to the field destroying any previous change
> made by you.
>
> With the new code that we will publish in a few days (just to see if
> something else arises) the method Fieldput() informs to its linked
> datacontrol that the value of the field has changed. This does not happen
> whith FastAddNew and FastEdit methods.
>
> BTW, your sample has a lot of incongruences that I will like to comment:
>
> METHOD PushToChange( oSender ) CLASS TForm2
>
> DO CAsE
>
> CASE ::oFirst:lModify
> MsgAlert("First Field Changed, must saved.")
> IF !::oParent:oRs:Edit()
> MsgStop("Parent Dataset not going into Edit")
> ::Close()
> ELSE
> MsgInfo("Changed Values Must Now Writen Back")
> ::oParent:oRs:First:= ::oFirst:value
> ::oParent:oRs:Update()
> ::Close()
> Endif
> CASE ::oLast:lModify
> MsgAlert("Last Field Changed, must saved.")
> IF !::oParent:oRs:Edit()
> MsgStop("Parent Dataset not going into Edit")
> ::Close()
> ELSE
> MsgInfo("Changed Values Must Now Writen Back")
> ::oParent:oRS:RecLock() // Unnecessary
> ::oParent:oRs:FieldPut(2,::oLast:value)
> *::oParent:oRs:Commit() // Unnecessary
> ::oParent:oRs:Refresh() // Unnecessary
> ::oParent:oRS:UpdateControls() // Unnecessary
> ::oParent:oRs:FilUnlock() // Unnecessary
> ::oPArent:ORS:CANCEL() // WRONG, it should be UPDATE()
> ::Close()
> Endif
> CASE ::oStreet:lModify
>
> MsgAlert("STREET Field Changed, must saved.")
> IF !::oParent:oRs:Edit()
> MsgStop("Parent Dataset not going into Edit")
> ::Close()
> ELSE
> MsgInfo("Changed Values Must Now Writen Back")
> ::oParent:oRS:RecLock() // Unnecessary
> ::oParent:oRs:aFields[03]:Value:= ::oStreet:Value
> ::oParent:oRs:Refresh() // Unnecessary
> ::oParent:oRs:UpDateControls() // Unnecessary
> ::oParent:oDBBrowse1:RefreshCurrent() // Unnecessary
> ::oParent:oRs:FilUnlock() // Unnecessary
> ::oParent:oRs:CANCEL() // WRONG, it should be UPDATE()
> ::Close()
> Endif
>
> Otherwise
> MsgInfo("No Changes form closes.")
> ::Close()
> ENDCASE
>
>
> RETURN Nil
>
>
> --
> Ignacio Ortiz de Zúñiga
> Xailer support / Soporte de Xailer
> http://www.xailer.com
> http://www.xailer.info
> "Dionisis Divaris" <info@sgs-soft.gr> escribió en el mensaje
> news:4a410002$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
>> Hello Ignacio
>>
>> In this post you find a modified demo, please compile it with both
>> versions March 2009 and June 2009 and press the button simulate problem.
>>
>> I wait your conclusions.
>>
>> TIA
>> Dionisis
>>
>>
>
>
T.I.A
Dionisis
SGS-soft
support.sgs@gmail.com
Responder