I want to add a record to a table. Table is in a back-end Access 2003 mdb, and is locked to avoid multi-user conflict. I use OpenDatabase, then open the DAO recordset:
It works great the first time I run it. Then I get error 3262, table is locked by another user. Since it's just me here that suggests of course that I left my table open.
I do have a form open that uses that table as recordset basis, but that's open before the first time I call the routine.
What am I leaving undone?
[purple]_______________________________
Never confuse movement with action -- E. Hemingway [/purple]
Code:
Dim HomerBE As DAO.Database
Dim rsProject As DAO.Recordset
Set HomerBE = OpenDatabase _
(strPath, False, False, "MS Access; pwd=yimpy")
Set rsProject = HomerBE.OpenRecordset _
(strSQL, dbOpenDynaset, dbDenyWrite)
rsProject.AddNew
' ... populate fields
rsProject.Update
rsProject.Close
Set rsProject = Nothing
Set HomerBE = Nothing
It works great the first time I run it. Then I get error 3262, table is locked by another user. Since it's just me here that suggests of course that I left my table open.
I do have a form open that uses that table as recordset basis, but that's open before the first time I call the routine.
What am I leaving undone?
[purple]_______________________________
Never confuse movement with action -- E. Hemingway [/purple]