Record Level Locking in Continous Form

ions

Access User
Local time
Yesterday, 23:51
Joined
May 23, 2004
Messages
816
Hello I am trying to get Record Level Locking on a continous form in Access 2000. I am only familiar with DAO

I've read 2 articles on this topic in MS KB.

1)http://msdn.microsoft.com/library/d...deovrpagelevellockingvsrecordlevellocking.asp

This recomendations in the above article don't work for me. It always does page locking.

2) http://support.microsoft.com/kb/306435/en-us "PRB: Jet 4.0 Row-Level Locking Is Not Available with DAO 3.60"

This seems to be the solution as many Access MVP's recommend it but I can't get it to work.

*****************************************************
First of all what do they mean by "In Visual Basic, create a new Standard EXE project" maybe this is the step I don't understand.

What I did was make a new blank database, created a module and inserted the recomended function (see below SetRecordLock function ). Then I call the SetRecordLock function and then just keep that database open.

(The database which I want record locking on is called Part1.mdb)

Next, I open the original database (Part1.mdb) which I want the record level locking on but still get page level locking.

I have the Options -> Advanced, "Default Record lock" attribute set to No Locks in both databases and the "Record Level Lock" check box selected.

For the forms which I want locking in I select "Record Locks" Edited Record.

What am I doing wrong? What is wrong in my understanding?

Thank you.

Peter.

******************************************************
'Copy of function in Article 2.

Public Function SetRecordLock()
Dim cnn As ADODB.Connection

'ADO has the ability to open row-level locking; DAO does not.
'The following code is used to implement row-level locking in DAO.
'If the database is opened first in row-level locking in ADO,
'subsequent attempts to open the database in ADO and DAO will use
'the same mode.

Set cnn = New ADODB.Connection
cnn.Provider = "Microsoft.JET.OLEDB.4.0"
cnn.Properties("Data Source") = "C:\Documents and _ Settings\PeterJr\Desktop\Part1.mdb"
cnn.Properties("Jet OLEDB:Database Locking Mode") = 1
cnn.CursorLocation = adUseServer
cnn.Open

Set wsDAO = DBEngine.CreateWorkspace("WorkSpace", "Admin", "", _dbUseJet)
Set dbDAO = wsDAO.OpenDatabase("C:\Documents and Settings\Peter_ Jr\Desktop\Part1.mdb")

'Close the ADODB connection.
cnn.Close
Set cnn = Nothing

End Function
 

Users who are viewing this thread

Back
Top Bottom