My colleague is developing a VB program to work concurrent with my current VFP program. In my program i use to use rlock() to lock a record (reserve a record,sound stupid but is user request). Now my friend want to determine or lock a vfp table record from his VB program. So i suggest he use VFP OLE DB with ADO to connect to the VFP table. After that we found out some VFP command can be execute from VB by using:
strSQL = "SYS(2003)"
oConn.Excecute (strSQL)
But when we try
strSQL = "RLOCK()"
oConn.Excute (strSQL)
It return true .but i still can access the record from VFP with rlock().and make modification on it.
My friend built the connection with code (VB code) below :
even though i set the ADO recordset LOCKTYPE = 2 but it still not working.Please somebody help.
strSQL = "SYS(2003)"
oConn.Excecute (strSQL)
But when we try
strSQL = "RLOCK()"
oConn.Excute (strSQL)
It return true .but i still can access the record from VFP with rlock().and make modification on it.
My friend built the connection with code (VB code) below :
Code:
Dim Cn As ADODB.Connection
Dim strCn As String
Dim rstCn As ADODB.Recordset
strCn = "Provider=vfpoledb.1;"&
"Data Source=C:\tmp\;" &
"Collating Sequence=general"
Set Cn = New ADODB.Connection
Cn.Open strCn
Set rstCn = New ADODB.Recordset
rstCn.Open "AC", Cn, , , adCmdTable
strSQL = "RLOCK()"
a = n.Execute(strSQL) 'a(0) return True
even though i set the ADO recordset LOCKTYPE = 2 but it still not working.Please somebody help.