开发者

Connect to an Access database with ODBC via ASP.net

开发者 https://www.devze.com 2022-12-20 09:46 出处:网络
I\'m trying to set an ODBC connection to a MS Access, with an Asp.net app. I keep getting this error message:

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


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.


For those who crash here with the same error. Try to put the MDB file under your domain folder and then create DSN. This resolved my issue.

UPDATE: If you are using datasource, make sure that "exclsive" is unchecked

Connect to an Access database with ODBC via ASP.net

0

精彩评论

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

关注公众号