Discussion:
How do we lock rows in Visual Fox Pro from a .NET front end ?
(too old to reply)
Chakravarthy
2009-02-25 07:06:29 UTC
Permalink
However, how do we lock rows in VFP ? The following is a message from my
team mate . Can anyone give some ideas ?

Regards,
Chak.

===============================================================================================
The Commands which we used to lock the record in Visual FoxPro is

· Command String="Set Reprocess to 5 seconds"


· Command String="EXECS([USE customer AGAIN SHARED IN 0]+ chr(13)+
[RETURN RLock('RecordNumber', 'customer')])";

The Visual FoxPro attempts to lock the record or file based on specified
number of seconds (i.e. 5 seconds) using the above mentioned first command
string.

We used RLock () function in which we are locking the record based on record
number but not based on the Primary key.

(To use Rlock Function the fox pro table must be indexed)

· The syntax of RLock () function is

RLOCK ([nWorkArea | cTableAlias] | [cRecordNumberList, nWorkArea |
cTableAlias])· To get the cRecordNumberList we used RECNO ()
function

· The syntax of RECNO ()

RECNO ([nWorkArea | cTableAlias])· It returns a value on
which the record pointer is positioned i.e. we can get only the first record
number. We cannot get the selected record number.

Ex:

When we execute the query "RECNO (Customer)"

We will get the output "1" indicating the first record.
So we are not able to lock the selected record to perform concurrency
control.

Also Oledb does not return the error message and also it does not return any
exception and simply executes the command .
===========================================================================================================
swdev2
2009-02-27 10:51:28 UTC
Permalink
you asked the same question in another group, vfp.dbc, and got some good
answers.

Yer gonna have to write code and test...


--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.terrafox.net www.viasqlserver.net
Post by Chakravarthy
However, how do we lock rows in VFP ? The following is a message from my
team mate . Can anyone give some ideas ?
Regards,
Chak.
============================================================================
===================
Post by Chakravarthy
The Commands which we used to lock the record in Visual FoxPro is
[snip]
Loading...