By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,143 Members | 1,908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,143 IT Pros & Developers. It's quick & easy.

Access 2000 VB6 Adding Records Locking Error

P: n/a

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.
With rs
!no = 1201
![Key] = 101
![Index] = 287
!saledate = Date
!userid = 97
!saletime = 44
!tid = 1
!paymethod = 1
!terminalid = 100
End With
I am running two instances of the same application to test this
Please Help



Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.