Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I open a MS access mdb file on CD with Delphi

Due to the MS Access database file generating a .ldb lock file when the .mdb file is open I get error trying running a Delphi application on CD where the database file also is on the CD.

Is there any solution for this problem?

like image 532
Anders Pedersen Avatar asked May 27 '11 13:05

Anders Pedersen


People also ask

How do I open an MS Access MDB file?

As you'd expect, you can open an Access database with Microsoft Access, and probably some other database programs as well. Excel will import MDB files—from the Data > Get Data > From Database > From Microsoft Access Database menu—but that data will then have to be saved in some other spreadsheet format.

What program reads MDB files?

The . mdb extension has been used for a series of proprietary file format versions, developed and used by Microsoft as a native format for its Microsoft Access desktop database management system, which was first released in 1992.


Video Answer


1 Answers

Yes. You need to specify that you're opening the database in read-only mode. You didn't specify how you are opening the Access database, but for example, if you were using the ADODB COM objects, you would do something like this your your ADODB Connection object:

    conn.Provider := 'Microsoft.Jet.Oledb.4.0';
    conn.Mode := adShareDenyWrite;
    conn.Open('database.mdb');

Or within the connection string itself:

    conn.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;' + 
        'Data Source=database.mdb;' +
        'Mode=Share Deny Write';
    conn.Open;
like image 114
Michael Edenfield Avatar answered Sep 28 '22 01:09

Michael Edenfield