![]() |
OpenDatabase recommended practise
OpenDatabase recommended practise
I have an excel spreadsheet that accesses a database with the following typical sequence Set db = OpenDatabase(Range("dbFullName").Value) 'opens the database Set rst = db.OpenRecordset("Statements") 'opens the Table 'read, edit or add records rst.Close db.Close Now it happens from time to time that I get an error message "file locked for editing". From some internet research I have checked the properties of the file or folder and I see it is not "read only", which has been the normal published problem. Other times I get a message that the database/recordset is already open. My question is: Should one open the database on opening of the Excel workbook and rather leave it open until you close the workbook, or should you open and close the db and rst everytime you access the database. Many thanks Laurence |
All times are GMT +1. The time now is 12:26 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com