I have been reading the Acess database for the past two days except for my class. It brings me some troubles, but I am still working on these troubles ~~~~ I encountered such a problem yesterday afternoon. The prompt is always displayed: the file cannot be found. I carefully checked the path of the database I created and found this problem for a long time ~~~~~
Suddenly, I thought that the database I used was a database created with access 2010, is it because of this ??? I check its attributes. The extension of the database created by access 2010 is accdb, And I still use the MDB format in the code. I think, maybe this is the reason ?!
If you change the format, a prompt is displayed:
Why ??? After standing on the shoulders of giants, I found the problem:
It turns out to be strcn = "provider = Microsoft. Jet. oledb.4.0; persist
Security info = false; "&" Data Source = "& App. microsoft. jet. oledb.4.0 is playing a strange role. The solution is to change it to Microsoft. ace. oledb.12.0.
Now let's compare the two differences:
Microsoft. Jet. oledb.4.0 (hereinafter referred to as the jet engine), you can access the Office
97-2003 (the extension is MDB), but cannot be accessed in these versions.
Microsoft. Ace. oledb.12.0 (hereinafter referred to as the ace engine), the ace engine is
2007 the database connection component released together can access the Office
97-2003. You can also access Office 2007 or later versions (the extension is accdb ).