Can you open Access 2007 database using Delphi 2010 on a computer that doesn't has MS Access instaled?
3 Answers
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 :-).
I think you will need to download this: Microsoft Access 2013 Runtime From:
https://www.microsoft.com/en-us/download/details.aspx?id=39358