LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenDatabase Error Steve Haack Excel Programming 3 January 26th 10 02:42 PM
Practise files in Excel 2007? Lexagonal New Users to Excel 1 September 11th 07 02:42 PM
Best practise XLA add-in L-E Eriksson Excel Programming 3 October 13th 06 05:05 PM
OpenDatabase-Problem Chip Pearson Excel Programming 1 January 20th 04 03:05 PM
Dao.OpenDatabase gives me error when ... Marek S. Excel Programming 0 July 28th 03 12:12 PM


All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"