views:

327

answers:

1

Hi there

I'm trying to set an ODBC connection to a MS Access, with an Asp.net app. I keep getting this error message:

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data. 
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed 
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data

I understand that maybe this has something to do with permissions because it works fine in a local app(console application).

already tryed to give read\write permission to 'IUsr_my-machine' but it still doesn't solve the problem

tks

+1  A: 

It's not permissions. It's that the database is actually opened in MS Access somewhere. Opening an access database with the MS Access itself is different than connecting to it from another program. MS Access will lock the db while you work on it. You need to find who has it opened in MS Access and beat them over the head until they close the Access program.

After you do that, report to my office so I can beat you myself for choosing Access as a web database. That's a really dumb thing to do, because Access is an in-process or desktop class engine. Web sites really need a server-class engine like sql server express that can do a better job handling concurrent users.

Joel Coehoorn
what? access sucks? I should try sql server? why didn't I thought of that earlier? oh yeah, I DID. using also access is not dumb, it's courage, so you shouldn't threat people who try to do crazy stuff with access like that!!! but tks for the tip anyway. (didn't work by the way)
DJPB
@DJPB You don't have to use sql server - just don't use access. And it's not blind hatred. I'm equally skeptical of sqlite, OpenOffice Base, and any other _in process_ engine. If you'd rather go Oracle, MySql, PostGRESQL, or even DB2 for goodness sake, be my guest. Just don't use an in-process engine on the web.
Joel Coehoorn
just kidding a bit joel, don't get me wrong. I already have connections to a couple of db engines working, and I agree that it's a far better approach. I was just curious to see what was the behavior with access or excel, for example. and well, I saw it... by the way, (if anyone faces the same problem) it works when you give read and write permissions to the "everyone" group. but that is a bad policy
DJPB
For what it's worth, I'm a dedicated Access developer and a big fan of Jet/ACE as a data store, and I would never use Jet/ACE as the database behind a website except if it was read-only, extremely low traffic or simply for proof of concept (though with MySQL running on my development desktop, I hardly need it for that). Joel's reaction is not the usual Access bigotry -- it's a case of steering people away from a usage that is inapproparite for a database that is great in a whole lot of other scenarios.
David-W-Fenton