Discussion:
Using FoxPro with .NET 3.5
(too old to reply)
Chakravarthy
2009-02-23 12:44:15 UTC
Permalink
Hello,

This must be an old question. How can one program a .NET 3.5 or .NET 2.0
Windows forms application against a FoxPro database ?

Thanks and regards,
Chakravarthy
Craig Berntson
2009-02-23 15:57:21 UTC
Permalink
Use the VFP OLE-DB Provider.
--
Craig Berntson
Microsoft MVP

-------------
Post by Chakravarthy
Hello,
This must be an old question. How can one program a .NET 3.5 or .NET 2.0
Windows forms application against a FoxPro database ?
Thanks and regards,
Chakravarthy
Chakravarthy
2009-02-25 06:54:45 UTC
Permalink
Thanks.

However, how do we lock rows in VFP ? The following is a message from my
team mate . Can anyone give some ideas ?

Regards,
Chakr

===============================================================================================
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 .
===========================================================================================================
Post by Craig Berntson
Use the VFP OLE-DB Provider.
--
Craig Berntson
Microsoft MVP
-------------
Post by Chakravarthy
Hello,
This must be an old question. How can one program a .NET 3.5 or .NET 2.0
Windows forms application against a FoxPro database ?
Thanks and regards,
Chakravarthy
Craig Berntson
2009-02-25 16:58:52 UTC
Permalink
The VFP Help file has a list of commands that are supported in the OLE DB
provider. I see that LOCK() is one of them.
--
Craig Berntson
Microsoft MVP

-------------
Post by Chakravarthy
Thanks.
However, how do we lock rows in VFP ? The following is a message from my
team mate . Can anyone give some ideas ?
Regards,
Chakr
===============================================================================================
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.
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 .
===========================================================================================================
Post by Craig Berntson
Use the VFP OLE-DB Provider.
--
Craig Berntson
Microsoft MVP
-------------
Post by Chakravarthy
Hello,
This must be an old question. How can one program a .NET 3.5 or .NET 2.0
Windows forms application against a FoxPro database ?
Thanks and regards,
Chakravarthy
Loading...