0

I wrote an application with VS2008 on Windows XP, and produced an .EXE file.

This application will only run on Windows XP OS. It fails on Vista and Windows 7.

It gives an error saying that a Microsoft OLEDB JET 4.0 occurred.

I use Microsoft Access as a db in this app.

What should I do?

  • Surely the error message gives a bit more than that. Can you give the exact error message? – MarkJ Jul 19 '10 at 11:58

2 Answers2

1

If your application is built for "any CPU" and you're running under x64 variants of Windows 7 and Vista, then try setting your build configuration to x86 (i.e. The 32 bit variant). There aren't x64 drivers for Access as far as I'm aware.

Good luck

Adrian Conlon
  • 3,941
  • 1
  • 21
  • 17
  • There are 64 drivers for Access with 2010 version: http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&displaylang=en – Fionnuala Jul 18 '10 at 20:01
  • Sorry,i don't undrestand.You mean that when i want to run the app in vista or 7,i have to install the Jet 4.0 related to each OSs? – SamanehHasani Jul 19 '10 at 06:31
  • 1
    Not really. First of all: are you running under x64 variants of Windows 7/Vista. If so then you have two choices: 1) Build for 32 bit CLR (could be easiest route) or 2) install x64 drivers for access (from the link given by Remou). If you're running on a 32 bit o/s, then neither my answer (or comments) really apply. – Adrian Conlon Jul 19 '10 at 12:50
  • Looks like Moleski is right. see this other question http://stackoverflow.com/questions/1735392/the-microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine – MarkJ Jul 19 '10 at 14:06
0

Where is the access database: is it in Program Files? In which case you might be suffering from virtualization - on Windows Vista and 7 the operating system won't allow you to write to Program Files, so it silently redirects you to another directory.

Community
  • 1
  • 1
MarkJ
  • 30,070
  • 5
  • 68
  • 111
  • I did what you said,but it didn't work and the same error occured: Microsoft Jet 4.0 OLEDB isn't registered in local machine. – SamanehHasani Jul 19 '10 at 12:50
  • For what it's worth, the Programs folder has not been an appropriate location for user-writable data since the release of Windows 2000, i.e., more than 10 years ago. User-writable data belongs in the user's profile and nowhere else. – David-W-Fenton Jul 19 '10 at 19:47