开发者

ESENT database engine file access denied

I am trying to using the ESENT windows database with the managedesent library but I always get the error

Error FileAccessDenied (JET_err开发者_如何学PythonFileAccessDenied, 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.


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.


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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜