If the first VO program adds/updates a DBF record (rlock, commit, unlock), the first app see the changes, but the second X# (or C#) program does not see the changes and oDBServer:Seek(..) fails . If the second program closes the DBF and opens it again, the changes are visible.
BTW, i tried DBServer and direct VODB functions with the same result.
I wrote the above earlier, and now while "playing around", I added oDBServer:OrderKeyCount() just before the oDBServer:Seek(...) and the changes are visible and Seek() works!! I tried Skip(0), GoTop() methods but those had no effect.
What's going in OrderKeyCount() which resolves the issue?
Jamal
The OrderKeyCount() from DBServer2.prg is below:
Code: Select all
METHOD OrderKeyCount( uOrder, oFSIndex )
//SE-060601
LOCAL dwCurrentWorkArea AS DWORD
LOCAL uRetVal AS USUAL
LOCAL oError AS USUAL
LOCAL cTarget AS STRING
#IFDEF __DEBUG__
DBFDebug("Entering "+__ENTITY__, AsString(uOrder), AsString(OFsIndex))
#ENDIF
lErrorFlag := FALSE
BEGIN SEQUENCE
VODBSelect( wWorkArea, @dwCurrentWorkArea )
IF IsObject(oFSIndex) .and. __Usual.ToObject(oFSIndex) IS FileSpec VAR oFS
cTarget := oFS:FullPath
ELSE
IF IsString( oFSIndex )
cTarget := oFSIndex
ENDIF
ENDIF
IF ! VODBOrderInfo( DBOI_KEYCOUNT, cTarget, uOrder, @uRetVal )
BREAK ErrorBuild(_VODBErrInfoPtr())
ENDIF
__DBSSetSelect( dwCurrentWorkArea )
RECOVER USING oError
oErrorInfo := oError
__DBSSetSelect( dwCurrentWorkArea )
SELF:Error( oErrorInfo, #OrderKeyCount )
uRetVal := NIL
END SEQUENCE
#IFDEF __DEBUG__
DBFDebug("Leaving "+__ENTITY__, AsString(uRetVal))
#ENDIF
RETURN uRetVal