Reputation: 36846
I am trying to using the ESENT windows database with the managedesent library but I always get the error
Error FileAccessDenied (JET_errFileAccessDenied, Cannot access file, the file is locked or in use)
The code to open the database is
m_Dictionary = new PersistentDictionary<string, PropertyStruct>("BaseEstateCachedPropertySummary2");
I am testing this on Windows 7 and the application is an ASP.NET application. Does anyone have any ideas about this, documentation is pretty slim.
Upvotes: 1
Views: 1627
Reputation: 36846
I found an answer. Apparently I didn't have write permissions to the default directory where it puts the database so I had to specify the full path such as.
m_Dictionary = new PersistentDictionary<string, PropertyStruct>(@"c:\Data\BaseEstateCachedPropertySummary2");
Upvotes: 1
Reputation: 2853
Are you trying to open an existing database used by another service (e.g. the Windows Update database)? Esent databases are single-process only so you have to stop any other processes that are using the same database.
Upvotes: 1