D
dpnews
My VB6 app used DAO 3.5 in page locking mode. WHen a locking error accured
you could trap error 3260 which told you the workstation name that was
locking the page.
I have upgraded my app to use DAO 3.6 and us the ADO method to open the
database in record locking mode before openning it with DAO.
Global db_comp As DAO.DataBase
Global wsDAO As DAO.Workspace
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") = Company
cnn.Properties("Jet OLEDBatabase Locking Mode") = 1
cnn.CursorLocation = adUseServer
cnn.Open
Set wsDAO = DBEngine.CreateWorkspace("WorkSpace", "Admin", "",
dbUseJet)
Err.Clear
Set db_comp = wsDAO.OpenDatabase(Company, SingleUser, False)
When a locking error occurs now I get error 3218. This does not specify who
is locking the record.
Does anyone know how to acheive this as it is extreemly useful
Cheers
Dave
you could trap error 3260 which told you the workstation name that was
locking the page.
I have upgraded my app to use DAO 3.6 and us the ADO method to open the
database in record locking mode before openning it with DAO.
Global db_comp As DAO.DataBase
Global wsDAO As DAO.Workspace
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") = Company
cnn.Properties("Jet OLEDBatabase Locking Mode") = 1
cnn.CursorLocation = adUseServer
cnn.Open
Set wsDAO = DBEngine.CreateWorkspace("WorkSpace", "Admin", "",
dbUseJet)
Err.Clear
Set db_comp = wsDAO.OpenDatabase(Company, SingleUser, False)
When a locking error occurs now I get error 3218. This does not specify who
is locking the record.
Does anyone know how to acheive this as it is extreemly useful
Cheers
Dave