General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How to refresh screen w/ new val as other user updates field
I used SQLEXEC to give me a cursor, & used CURSORSETPROP to make the cursor updatable. Currently using VFP database, with possibility to convert to SQL in the future. User opens up a form class that displays a record, with command buttons to go to NEXT or PREVIOUS record.
Currently, this is how I set up one of my text field:
.controlSource=cMyTable.refno
As another user updates the original table (myTable), I’d like have all users’ screen to refresh with the new updated value(s). What do I need to change to be able to do so? (example: if user A changes refno from 12 to 146, then I’d like user B to see 146 instead of 12 as user B’s screen refreshes – maybe as he goes to the next record & gets back to it).
lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
"SourceDB=c:\projects\myData.dbc;SourceType=DBC;UID=;PWD=;"
THIS.lnHandle=SQLSTRINGCONNECT(lcConnStr)
IF THIS.lnHandle>0
lSuccessMyTable=SQLEXEC(THIS.lnHandle,"SELECT * FROM myTable","cMyTable")
IF lSuccessMyTable=1
SET MULTILOCKS ON
CURSORSETPROP('Buffering',5,'cMyTable')
CURSORSETPROP('TABLES','myTable','cMyTable')
CURSORSETPROP('UPDATABLEFIELDLIST','refno,budgetcode','cMyTable')
CURSORSETPROP('KeyFieldList','refno','cMyTable')
CURSORSETPROP('UpdateNameList','refno myTable.RefNo,budgetcode myTable.budgetcode','cMyTable')
CURSORSETPROP('FetchMemo',.T.,'cMyTable')
CURSORSETPROP('SendUpdates',.T.,'cMyTable')
ENDIF
ENDIF
TABLEUPDATE(0,.F.)
Thank you all!
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only