system.data.oledb.oledbexception (0x80004005): could not find file

元气小坏坏 提交于 2019-12-02 03:32:05

Do check that the path point to a mdb in the App_Data folder

Not very sure but if the database is inside the App_Data folder, simply use:

"PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|StaffingSystem_DB.mdb"

Your data file is an accdb file, thus requiring the ACE provider instead of the JET provider. Use the JET provider to read mdb or xls files. The ACE provider, on the hand, can read mdb, accdb, xls, xlsx, plus other formats.

Also, it is best to specify complete path to you file in the Data Source property of your connection string.

Goto Project properties->Publish->Application File, in the applications file window change Publish Status of something.accdb from Include(Auto) to Data File

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!