ViFer
ViFer

Reputation: 283

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

Can someone help me with this error please? I can't figure it out. I have this error on Windows XP but not on Windows 7. What I did is i attached a photo and save it to the database (MS Access as my database). The photo appears on the picture box but then after that all is a mess. Im using C#.

enter image description here

Upvotes: 1

Views: 12873

Answers (3)

TK Mphahlele
TK Mphahlele

Reputation: 91

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

Upvotes: 0

user2835707
user2835707

Reputation: 31

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.

Upvotes: 3

Rahul Tripathi
Rahul Tripathi

Reputation: 172618

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"

Upvotes: 1

Related Questions