简体   繁体   中英

Database Connection: Visual Studio 2010 and Microsoft Access 2007(OleDbException was unhandled)

I am new in creating application using Visual Studio 2010 and Microsoft Access 2007. I tried connecting Visual Studio with MySQL as a database and it worked fine but when I changed it to MS Access I got errors stating that OleDbException was unhandled and could not find the file . The database file I created is in the same folder where the program is located

This is the printscreen of the error: 在此处输入图片说明

The exception is telling you what the problem is: "The workgroup information file is missing or opened exclusively by another user".

Microsoft has a full explanation and solution here .

My understanding is that you need to set your Build Settings to target x86 cpu for the JET.OleDb Provider to work. If you are targeting "ANy CPU" or x64, you will run into an exception.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM