2

Silly question, perhaps.

I've developed an app on my machine that uses a Microsoft Access database (.mdb) to access certain information and populate a table with monitoring data using OLEDb.

The application works fine on my machine, but when I put the release on test machines (without MS Access), it crashes. Interestingly, if I were to launch the application on the testing machine with the database filename just renamed, it loads like it should albeit without the data.

I seem to get an UnauthorizedAccessException exception thrown which further clouds my confusion.

Both the development machine and the machine I'm testing it on have .NET 3.5 installed.

I would expect a barage of 'No's in reply to my question, but what the heck - does the testing machine need to have MS Access installed?

Regards

Larry Lustig
  • 49,320
  • 14
  • 110
  • 160
Ric
  • 683
  • 2
  • 11
  • 19
  • 3
    As a developer, you need to learn the difference between Access (a database application development platform) and Jet/ACE, the default database engine that is the default db engine for Access. Your question is about Jet/ACE. It has nothing to do with ms-office. For MDB format, you should have no problems as Jet has been installed on all versions of Windows starting with 2000 (it's part of the OS distribution). However, the OLEDB drivers for Jet may not be installed or may not be compatible versions. – David-W-Fenton Nov 06 '09 at 22:11

6 Answers6

4

Try downloading the Office Connectivity Components here. This will let you read and create Access databases without having Access installed.

Brian Ensink
  • 11,092
  • 3
  • 50
  • 63
  • Even with the Data Connectivity Components installed in the end users machines PC, if they don't have Office installed, you still have the same problem. I'm facing this issue right now. – Mauricio Arias Olave Aug 22 '16 at 14:41
2

It doesn't need MS Access but you will need the required driver for your version of Access. You may need to do a test release that outputs to a log the exact Exception and message.

James
  • 80,725
  • 18
  • 167
  • 237
2

Make sure you have latest Jet 4 OLEDB drivers installed. There might also be a problem if you run the application from a network share (then it runs with restricted rights).

MicSim
  • 26,265
  • 16
  • 90
  • 133
  • MDAC has not included Jet for years and years, precisely because Jet is part of the OS (since Win2000), but I don't know if the current MDAC includes the Jet 4 OLEDB drivers (which seem to be in use by the OP, based on the OLEDB tag). – David-W-Fenton Nov 06 '09 at 22:12
  • You're right. Thanks for pointing out. I meant the Jet drivers. – MicSim Nov 07 '09 at 12:17
1

You say you got an UnauthorizedAccessException. I'd check read/write permissions to the .mdb file and location first.

If you're running as a service remember that they run under more restricted accounts.

Simon P Stevens
  • 27,303
  • 5
  • 81
  • 107
1

You don't need Access itself. You will need to have JET drivers and associated files at least as current as the ones on your development machine — if you're recycling an old machine to use for testing that could be the problem.

However, this really sounds like a permissions issue, either on the database file itself or inside the file if you're using Access's security mechanisms.

Larry Lustig
  • 49,320
  • 14
  • 110
  • 160
  • Actually DAO 3.6 and Jet 4.0 have been installed as part of the Windows OS since Windows 2000. Assuming that's what you meant by Jet drivers. – Tony Toews Nov 06 '09 at 18:50
  • 1
    But the question is tagged OLEDB, and, so far as I know, the Jet 4 OLEDB drivers are *not* installed by default as part of the Windows installation. Yes? No? – David-W-Fenton Nov 06 '09 at 22:14
  • James, eh? Jet 4.0 is installed by default on Windows 2000, XP, Vista and 7. – Tony Toews Nov 07 '09 at 05:53
  • Jet 4.0 is not installed by default in Windows 2003 or Xp, You must download for XP at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2deddec4-350e-4cd0-a12a-d7f70a153156 and for 2003 at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=97BC8126-5C60-44BC-A2CE-1E40C7FE2B34 – Jalal Dec 28 '10 at 12:49
1

It turns out the issue was a hardware problem. One of the serial ports on the card I was using had gone capput when it got moved to a new machine.

Turns out the problem wasn't database related, as the exception would've suggested.

Some interesting points on JET were raised though, which could be useful to anyone with Database access issues.

Thanks for your help guys.

Ric
  • 683
  • 2
  • 11
  • 19