1

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 :/

AdorableVB
  • 1,383
  • 1
  • 13
  • 44
  • http://stackoverflow.com/questions/21750591/automatically-renumber-records-in-an-access-table-after-data-changes-have-been-m -- This was the database Gord Thompson gave me, its working in my PC, and not to others. Its a 2010 version. About your question, I am on a 32 bit version, and 64 on the other. I don't know what's on the laptop. – AdorableVB Feb 21 '14 at 02:08
  • if you are using COMPACT ON CLOSE, see this http://stackoverflow.com/a/3432303/1070452 which sounds more likely than a 32/64 issue as I think of it – Ňɏssa Pøngjǣrdenlarp Feb 21 '14 at 02:11
  • I don't use it, since its off by default. Anyway, the app, in which its database is the one I created, it works fine, but when I use the database from Gord, it does not. But if perfectly works on my pc. – AdorableVB Feb 21 '14 at 02:18

1 Answers1

2

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....)

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
  • Congratulation on your ms-access gold badge, Gord. You deserve it. – HansUp Feb 21 '14 at 14:12
  • It just feels weird. I am on a 32bit machine in which I created the first app. Works fine. Then I used your database, then it didn't. I recreated it in my Access. Same result. As from Plutonix, it may have been an OS issue, but I tried it on one 64bit, it worked, but on others, it does not. I was thinking if it was the macros, so just resented to creating a new app for the new database, and compile as x86 & x64. I will try that first. Thanks! – AdorableVB Feb 22 '14 at 00:47
  • There was a problem I encountered, you cannot install a 64bit engine in a 32bit access which is the only reason it is not reading the ACE 12.0 driver. I saw this http://www.codeproject.com/Tips/370922/Microsoft-Access-Database-Engine-2010-Redistributa to force the installation. Then it worked okay, by then, I just need to compile my app into either x86 or x64. – AdorableVB Feb 22 '14 at 06:28
  • @gord I am experiencing a little bit of problem in Access. I tried Database Engines of 2007 / 2010 in 64 and 32 bit OS. But on a PC that I installed all of them. Its still looking for the 12.0 driver. Why is that? Its opening the database, but when I put the data macros, then its unrecognized. What am I missing? BTW, I use 2010 access and compiled it to 2007. – AdorableVB Feb 27 '14 at 03:42