Search code examples
delphidelphi-7adoms-access-2013

Delphi 7 and Microsoft Access 2013 "Provider cannot be found. It may not be properly installed."


I'm having a problem with a program I am attempting to link to a Microsoft Access 2013 Database. In the program I have the following code in a unit which links the database to Delphi:

unit udbSrc;

interface

Uses DB, ADODB, Forms;

Var DBDataBase : TADOQuery;

Procedure OpenDB;

implementation

Procedure OpenDB;
Begin
DBDataBase := TADOQuery.Create(Application);
DBDataBase.ConnectionString := 'Provider=Microsoft.ACE.OLEDB.12.0;Data Source=' + '''DataBase.accdb'';Persist Security Info=False';
end;

end.

In the main unit I have the following code under the click of a button:

DBDataBase.Close;
DBDataBase.SQL.Text := 'Select * From tblPlayerInfo';
DBDataBase.ExecSQL;
DBDataBase.Open
DBDataBase.First;

When I click the button the program doesn't run with the following error message:

Provider cannot be found. It may not be properly installed.

And it identifies the error to lie in this line of code:

DBDataBase.ExecSQL;

I have done research and downloaded and installed AccessDatabaseEngine_x64 which did not have any effect. If anyone could please suggest a solution.


Solution

  • You say you have downloaded and installed AccessDatabaseEngine_x64, but this is the 64-bit provider. Delphi 7 produces 32-bit executable and therefore requires 32-bit providers. This is why you are getting the provider not found error. The required 32-bit provider is not installed.

    Download and install AccessDatabaseEngine.exe (not the _x64 version) to obtain the 32-bit provider you require.

    Typically when there is a choice of 32 or 64-bit versions of software the 32-bit version will be identified as x86 and the 64-bit version as x64. Having said that, in this case only the x64 version is explicitly identified in this way with the "plain" name being the alternative version only implicitly.