Tofig Hasanov
Tofig Hasanov

Reputation: 3709

Problems opening Access Database from Delphi 7

I am developing Delphi 7 application, which is operating with Access Database (MDB format). It works fine on my PC, and some other PCs as well. But on some machines application gives error when trying to access database sometimes, saying something like "Unkown database format (mdb)". Additionally I noticed one thing: When you open that database in Ms Access using Office, it is opened in "read-only" mode for some reason. Can anybody help? What could be the reason for the problem?

Upvotes: 0

Views: 2881

Answers (5)

Toby Allen
Toby Allen

Reputation: 11213

I think your most likely problem is to do with MDAC, use the registry to check what version is on each machine and see if there is a differnce between the ones that work and the ones that dont.

Upvotes: 1

lkessler
lkessler

Reputation: 20132

You say: "It works fine on my PC, and some other PCs as well."

Then it sounds like there might not be anything wrong with your program. What it could be is that the PCs it won't work on all the time do not have Microsoft Office or at least Microsoft Access installed. They need to have Access installed for ADO to work.

A "sometimes" problem on a machine is difficult to diagnose without further clues.

I'm afraid I don't know what the "Read-only" problem might be.

Upvotes: -1

Tony Toews
Tony Toews

Reputation: 7882

What version of Access is the MDB formatted for? Are you using DAO or ADO to access the databases. Is the MDB in 2003 or 2007? I suspect it's in A2007 format and the machines you are having troubles with have A2003 installed or no version of Access at all. Whereas the machines that work do have A2007 installed on them. But that's just a guess.

You also need to track down the read only problem too.

Upvotes: 1

J__
J__

Reputation: 3837

I used to get that error message if the database file (the mdb file) was actually set to read-only (for example, if it had been copied off a CD). Check the file properties in Windows Explorer and ensure the file isn't read-only.

Also, have you tried doing a Compact & Repair within Access, as Access databases regularly corrupt and this option can often help cause all manner of problems.

Upvotes: 1

ptutt
ptutt

Reputation: 1338

It's been a long time since I have programed in Delphi, but I remember I had issues with different versions of MDAC installed. Compare the versions between the pc's that work and those that don't.

Upvotes: 2

Related Questions