Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database locked exclusive

Status
Not open for further replies.

RaKKeR

Programmer
Nov 22, 2004
26
0
0
NL
Hi,

I'm using DAO to open an excel file as a database (I know, it can be done much better...) with the OpenDatabase method. The problem is that this method sometimes fails with the error message "Workgroup File is missing or file is opened in exclusive mode by other user". I downloaded a little file-monitoring application and I noticed that indeed the first time the excel file is opened with the opendatabase method the file is locked for a short time and than unlocked again. Probably the error occurs when this lock is still on... Whats the reason of this locking? I open the database in shared mode and readonly, and still I see the lock is placed every first time the DB is opened. Can I prevent this locking operation? To show you where the problem is here is the line where thats fails occasionally:

Code:
Set db = DAO.OpenDatabase("C:\Data\FOUTMELDINGEN_EN.xls", False, True, "Excel 8.0")

I hope someone can help me out here...

Thx in advance,

RaKKeR
 


I think you have to open the database using the CreateWorkspace method...


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
You should declare your database as

Code:
Dim db as DAO.database

and eliminate the DAO in your code snippet:

Code:
Set db = Opendatabase(".....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top