c# - OLEDB FOXPRO LOCK RECORD -
how lock foxpro table has sono='12345' oledb instead of locking whole table? using rlock(), can lock records number no idea how lock records using filter.
here how lock table record number
string vfp = "[ set exclusive off ] + chr(13) + "; vfp += " [ use table in 0 alias a_table ] + chr(13) +"; vfp += " [ lock('1,2,3,4', 'a_table ') ]";
dbconn.open(); using (oledbcommand cmd = dbconn.createcommand()) { cmd.commandtext = "exec( " + vfp + " ) "; cmd.executenonquery(); }
if position 'record pointer' on record wish lock, , call rlock() no parameters, record locked.
this sequence of commands it:
set exclusive off use table in 0 alias a_table select a_table locate sono='12345' rlock()
this assumes locate command finds record sono='12345'.
or, can use seek command or seek() function if have index can use.
Comments
Post a Comment