0
votes

Can you open Access 2007 database using Delphi 2010 on a computer that doesn't has MS Access instaled?

3
It depends on what you mean by open, if you mean use the ACE drivers, then microsoft.com/en-IE/download/details.aspx?id=23734 - Fionnuala
@Remou To use data from access database in delphi application on a computer without access. - sistemcrash

3 Answers

3
votes

Use a TADOConnection object and set its ConnectionString to the result of this function:

FUNCTION AccessConnStr(CONST FileName : STRING) : STRING;
  BEGIN
    {$IFDEF CPUX64 }
      Result:='Provider=Microsoft.ACE.OLEDB.12.0;Data source='+FileName
    {$ELSE }
      Result:='Provider=Microsoft.Jet.OLEDB.4.0.0;Data Source='+FileName
    {$ENDIF }
  END;

Just give the file name to the function, and it'll return the connection string needed to access the file. This works at least with Access MDB files - haven't tried anything else...

If you do not know how to use TADOConnection to access databases, search the net. That subject is too broad for a Q&A site like StackOverflow.

I have not had a machine (XP and newer) that have failed to access the .MDB file using this connection string - whether they had MS Office installed or not, but of course can't vouch for every single PC in the world :-).

2
votes

Yes, you can open an ADO connection to an MS Access database and access the data in the database.

0
votes

I think you will need to download this: Microsoft Access 2013 Runtime From:

https://www.microsoft.com/en-us/download/details.aspx?id=39358