Hi guys,
I have a xBrowse where I show rows of a MySql Table. This module is opened in several computers at the same time and records are being modified.
What is the best way to keep updated the rows that are being shown in this xBrowse?
Hi guys,
I have a xBrowse where I show rows of a MySql Table. This module is opened in several computers at the same time and records are being modified.
What is the best way to keep updated the rows that are being shown in this xBrowse?
oBrw:Refresh(.T.) ??Karinha,
No my friend, oBrw:Refresh(.t) doesn't help.
The records are being modified in other computers, so i wanted to know if there is a way to be notified when the records need to be updated in xbrowse, because they were modified in others computers.
I use a refresh button with oBrw:oRs:Requery()
Maurizio
Than you Maurizio,
Nowaday, I'm doing like you.
You could refresh the browse by using a timer (to read current data of changed items and if so refresh) so that changes on other computers will change the data on all computers.
Thank you Marc,
Yes, we're using a timer too. But I think xbrowser could have a method to Sync automatically all records that are been shown.
Look, not all the oRowset's records, just those that are visible right now in the xbrowser
Maybe a autosync can be build .... I think from a earlier post from Mr. Rao that Xbrowse only updates the visible rows and not need to read the full rowset.
In that post we where talking about uptimised filters and indexes and Mr. Rao wanted to explain that in full theorie/praktic but due to time/work that item was not covered yet.
You probebli know that speed issues over LAN are gone once using FWH with Remote Desktop.
Yes, Something like an autosync would be great!
Yes,
But, there he is doing autosyng in the same computer and I need it in different computers.
No my friend, oBrw:Refresh(.t) doesn't help.Obviously oBrw:Refresh() can not make oRs to read the records from the Server again.
oRowSet:Refresh()oRowSet:Resync() // --? lChangedoRowSet:NetChanged( [RecNo], [@lDeleted] ) // -->lChangedoBrw:bChange := { || If( oRs:NetChanged(), oBrw:RefreshCurrent(), nil ) }oRowSet:Resync() // --? lChangedHere, oRowSet:Resync() is always returning .T., even the record was not changed.
LOCAL lTem:=.F.,nPos:=0,nRegAt := ::oTab:Recno()
DEFAULT bBloco := {|| .T.}
::oTmr:DeActivate()
::oTab:Skip(::oLbx:nRowSel * (-1))
DO WHILE nPos < ::oLbx:nDataRows .AND. .NOT. ::oTab:Eof()
IF Eval(bBloco)
lTem := .T.
::oTab:ReSync()
ENDIF
nPos++
::oTab:Skip()
ENDDO ::oTab:GoTo(nRegAt)
IF lTem
::oLbx:Refresh()
ENDIF
::oTmr:Activate()