Why don't I get an error in the immediate window when I do the following ?
set ors = currentdb.OpenRecordset("artikel",,dbPessimistic)
set ors1 = currentdb.OpenRecordset("artikel",,dbPessimistic)
I was hoping that the second edit would throw an error, so that I could,through error trapping, use this for my recordlocking purposes. I need to prevent people two people to open the same record concurrently.
How is that handled then, apart for the obvious solution to have a "locked" table in the database?
So I went back to the doc, but I must say I'm still not convinced I understand this (in fact I am convinced that I don't understand this ) .
Here's a routine that runs from the immediate window without any runtime error, where I would have expected that when ors1 executes it's edit, the code would throw an error. To be complete, please note that "ARtikel" is a linked table.
Dim ors As DAO.Recordset, ors1 As DAO.Recordset
Set ors = CurrentDb.OpenRecordset("Artikel", dbOpenDynaset, dbConsistent, dbPessimistic)
Set ors1 = CurrentDb.OpenRecordset("Artikel", dbOpenDynaset, dbConsistent, dbPessimistic)
ors1.Edit 'expecting a run time error
Set ors = Nothing
Set ors1 = Nothing