Unrecognized database format to other PC

时光总嘲笑我的痴心妄想 提交于 2020-01-16 06:45:19

问题


I can't find the solution to my problem. So I asked.

 con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source = " & Path.Combine(Application.StartupPath, "piglets.accdb")

I was using Access 2010. It was working fine, with me and other PC's. Then I needed to change my database, it was given to me as a working sample from SO.
piglets.accdb - This is 2010 too, I think. I opened it, worked fine, incorporated it to my newly created app, with the same exact code. It was working with me, but not until I opened it to another PC, says, "Unrecognized database format" at Form_Load

UPDATE (Does this problem apply on PC's without MS Access?) I tried the working App on the PC without Access, and it was working fine.

And on a laptop, it did throw an error upon saving, but it was working with the first 2010 database.

What am I missing?
UPDATE 2 I re-created the database given to me by Gord, to a 2007 format (which was the database that worked on the other PC.) I tried it out, used the newly created one (2007 format with macros) its working fine on my PC, but then again, its not on the other PC. still, Unrecognized Format :/


回答1:


I suspect that the troublesome machine has Access 2007 on it. The Access 2007 version of the Access Database Engine (a.k.a. "ACE") does not recognize the file because Data Macros were a feature that was added in Access 2010.

The safest solution would be to upgrade that machine to Access 2010. However, if that is not feasible then you could upgrade the Access Database Engine (but not the entire Access application) to the 2010 version by downloading and running the installer available here.

That should allow your VB.NET application to use the Access 2010 .accdb file with the Data Macros in it. However,

  1. It will not enable the .accdb file to be opened in Access itself, since the Access 2007 application still won't recognize the Access 2010 database file format.

  2. That would probably be an unsupported configuration, so proceed at your own risk. (Although I did just try it on an old Office 2007 VM and it didn't seem to break anything....)



来源:https://stackoverflow.com/questions/21923753/unrecognized-database-format-to-other-pc

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