views:

224

answers:

6

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

+2  A: 

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
+3  A: 

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

Brian Ensink
A: 

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
+2  A: 

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
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
You're right. Thanks for pointing out. I meant the Jet drivers.
MicSim
+1  A: 

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
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
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
@David, you are correct Jet 4 is not installed by default.
James
James, eh? Jet 4.0 is installed by default on Windows 2000, XP, Vista and 7.
Tony Toews
+1  A: 

Hi all,

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 Coles