Jump to content
Beantreeze

Using FireDAC with Access accdb file

Recommended Posts

Hello -

 

I recently upgraded to Delphi 12 & Windows 11 upon receiving a new laptop at work. I have some older applications that use Access databases, all with the ".accdb" file extension (most current Access format). The applications are essentially deprecated, as we have new software to manage the data. However, in the meantime, I need to maintain these older applications and their data.

 

With my previous laptop and Delphi 11, I had no trouble using a FireDAC Connection to connect to my Access ".accdb" databases, once I installed the Access Database Engine. However, no such luck with my new laptop. Due to changes in the location of the databases (renaming of server and moving to new domain), I need to recompile these applications.

 

The issue appears to be only due to the version of the database file, as I can convert the .accdb file to an .mdb file and open the .mdb file successfully with FireDAC whether it's on the server or on my local drive. However, I cannot open the .accdb file either place. I get this error:

 

image.thumb.png.8b1f016c8b8c9bb4ca61fa350fd6c2ad.png

 

(I will avoid converting all my databases to .mdb, leaving that as a last resort).

 

I'm wondering if it might have to do with 32-bit or 64-bit versions of Office/Access. I thought I had been using 64-bit Office on my former laptop, and I know I'm using 64-bit on my new one.

 

Any suggestions? TIA

 

Teri

Share this post


Link to post

Do you have another tool installed on the new laptop that you can successfully use to connect to and view the data in the .accdb file?

Share this post


Link to post

Yes, I am able to open and use the file in Access, obvi, but also Excel through ODBC, which is what FireDAC is using, right?

Share this post


Link to post

The FireDAC docs say it's a driver issue. Is your application 32-bit or 64-bit?

Share this post


Link to post
Posted (edited)

Applications are 32-bit, but they've always been 32-bit. I cannot even connect to the database within the Connection Editor. Would changing to 64-bit change that? I'll try it.

 

No - did not change the issue in Connection Editor.

Edited by Beantreeze
additional info

Share this post


Link to post

Can you set it up and test it in the ODBC Data Source Administrator (32-bit)? It should tell you if the 32-bit drivers required are available/installed. If only the 64-bit drivers are installed the newer versions of this utility will mention it. For example on my system I do not have the 32-bit drivers:

 

 

 

 

Screenshot 2024-06-12 153708.png

Share this post


Link to post
Posted (edited)

I think you hit the nail on the head, @Brian Evans! It apparently does not list a 32-bit driver for Access. I hope I can download one. Thanks so much!

 

I think you're on the right track, but I don't see a solution for this. I'm planning to check my previous laptop once it's charged. <so frustrating>

Edited by Beantreeze
more info

Share this post


Link to post

You can only open MS Access files on a PC using either 64 bit apps (in which case you need to install the 64 bit MS Access drivers into Windows) or 32 bit apps (in which case you need MS Access on the machine (or at least the drivers). You cannot have both on the machine at the same time.

 

  • Like 1

Share this post


Link to post

Remember one think, Delphi 12.1 are still 32-bit. Therefore you need 32-bit driver for database, if you want to connect from Delphi

 

Share this post


Link to post
30 minutes ago, Jirka52 said:

Remember one think, Delphi 12.1 are still 32-bit. Therefore you need 32-bit driver for database, if you want to connect from Delph

This is true for design time connections. But you can compile to 64 bit application and then connect at run time (but if you do this you CANNOT connect at design time because of the limitation I mention above).

  • Sad 1

Share this post


Link to post

@Roger Cigol Yes, I think I will try compiling to 64-bit and open the database upon creation of the data module and see if that works for me. Otherwise, I'll have to make the changes on my old laptop then recompile 32-bit. 

 

Thanks all for the leg up!

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×