Hi
I use Visual Basic 6, Service Pack 6, Microsoft ActiveX Data Objects
2.8 Library(msado15.dll) and access 2000 database using JET 4 OLE. I
have an application that adds records simultaneously to the same table.
During the simultaneous add and update, a Locked error occurs, and most
of the times it locks all the machines.
I have been reading on Microsoft Site and on google groups that JET4
and ADO have fix for page locking , which should solve my problem, if
i am assuming it right. My understanding is, in that case, I should not
get a lock if i am opening the ADO Connection with the proper
parameters of Database Locking Mode, I should not get a locking error
while a simultaneous addition to the database is happening.
My code to open the Connection and the Recordset is :
Dim glConn as new adodb.connection
Dim rs as new adodb.connection
glConn.Provider = "'Microsoft.Jet.OLEDB.4.0';"
glConn.CursorLocation = adUseServer
glConn.Properties("Jet OLEDB:Database Locking Mode") = 1
glConn.Mode = adModeShareDenyNone
glConn.Open "k:\a\a.mdb", "admin"
rs.LockType = adLockOptimistic
rs.CursorLocation = adUseServer
rs.CursorType = adOpenDynamic
rs.Open "select * from transactions", glConn
To test , i am adding records to the same table, in a loop.
rs.AddNew
With rs
!no = 1201
![Key] = 101
![Index] = 287
!saledate = Date
!userid = 97
!saletime = 44
!tid = 1
!paymethod = 1
!terminalid = 100
End With
rs.Update
I am running two instances of the same application to test this
scenario.
Please Help
Regards
Brijesh