0

Possible Duplicate:
Trouble to open XLS file with oledb

I have a compiled Microsoft Access database (*.mde) on a newtwork drive. When I try to open it via myapplication (ASP.NET) on IIS 7.5 (Windows Server 2008) I get this error :

The Microsoft Access database engine cannot open or write to the file. It's already opended exclusively by another user, or you need permission to view and write its data.

This file is not use by anyone except by IIS.

Any idea ?

Thanks,

Community
  • 1
  • 1
TheBoubou
  • 19,487
  • 54
  • 148
  • 236
  • 1
    Show the code that is supposed to read this file. I suspect you are not closing handles by wrapping disposable resources in using statements. – Darin Dimitrov Oct 05 '11 at 11:33
  • 1
    IIS can access the database with more than one Thread. Btw: why using access? – Yves M. Oct 05 '11 at 11:33
  • Double thread - http://stackoverflow.com/questions/7658429/trouble-to-open-xls-file-with-oledb – KV Prajapati Oct 05 '11 at 11:43
  • @AVD no not same problem. Same solution tried but no success – TheBoubou Oct 05 '11 at 11:53
  • @YvesM. why access .... historical reason. – TheBoubou Oct 05 '11 at 11:54
  • @DarinDimitrov I'm going ot check code (not my code) working on my PC with Development server – TheBoubou Oct 05 '11 at 11:55
  • @Kris-I - Ms-Access is a file system database where each resource on web-server is protected. – KV Prajapati Oct 05 '11 at 11:55
  • @DarinDimitrov strange here http://goo.gl/HFyhD they said not call Close or Dispose – TheBoubou Oct 05 '11 at 12:07
  • @Kris-I, I have asked for your code, not a link to an MSDN article. – Darin Dimitrov Oct 05 '11 at 12:19
  • @DarinDimitrov I place here : http://pastebin.com/4P29pkVT the same "process" is used in some place. It's not my code ok keep that in mind :) – TheBoubou Oct 05 '11 at 12:37
  • Something strange when I launch the applicaiton from IIS no problem (http://localhost/Application ...) but when I do http://myserver/Application I get this error. – TheBoubou Oct 05 '11 at 14:05
  • Somebody doesn't know what an MDE is -- read the help file and you'll realize it has no advantage in this context over an MDB. The only possible reason it should be an MDE is if it's actually an Access application that is used interactively in Access. Frankly, using Jet/ACE behind a web server shows that somebody really, really doesn't know what they are doing, as it's wholly unsuitable for that purpose. – David-W-Fenton Oct 05 '11 at 22:55
  • @David-W-Fenton I agree but the application is like this and timing too – TheBoubou Oct 06 '11 at 05:41

1 Answers1

1

It is not sufficient to have write permission on the file, you must also have write permissions on the folder in which the file resides because Access creates a lock file (*ldb) which has to be written to for each successive user, otherwise the first user to open the file will lock it. In this case, permission is required by IUSR, AFAIK.

Fionnuala
  • 90,370
  • 7
  • 114
  • 152