Jump to content
Squall_FF8

Using TFDConnection for MS Acceess .accdb

Recommended Posts

Hi guys,

This one was suppose to be easy, but I cant setup a TFDConnection to connect to .accdb.

Is it possible? How to do it?

 

For looong reasons in my other post , I ended up with 64 bit application that tries to connect in runtime.
First I tried with ADO - all worked. I love using FireDAC, so I'm trying to do it with TFDConnection, - alas no success.

If it matters, here is ConnectionString for ADO:

Provider=Microsoft.ACE.OLEDB.12.0;Password="";Data Source=xxxx.accdb;Persist Security Info=True;Jet OLEDB:Database Password=xxxx

 

Edited by Squall_FF8

Share this post


Link to post

It would probably be relevant if you explained what you mean by "no success".

What errors are you getting, if any? What does your FireDAC connectionstring look like, etc.?

Share this post


Link to post
8 hours ago, Anders Melander said:

It would probably be relevant if you explained what you mean by "no success".

What errors are you getting, if any? What does your FireDAC connectionstring look like, etc.?

It will be very helpful to see a snippet of how to setup the connection with code (at runtime).

What i did? Well unlike MS SQL, I have no clue what property I need to set for Access.  So I setup DriverID = MSac, then I copied the ADO ConnectionString in FD ConnectionString with hope it will work.

P.S. Even if you set the connection at design time, if you can share the resulting ConnectionString, should be enough for start. 

Edited by Squall_FF8

Share this post


Link to post

I haven't used Access in... 25 years I think, so I can't help with specifics.

 

My guess is that you need to set up a ODBC DSN using the ODBC Data Source Admin. Once that is done I think you can configure FireDAC to connect to the ODBC DSN.

Share this post


Link to post
14 hours ago, Squall_FF8 said:

This one was suppose to be easy, but I cant setup a TFDConnection to connect to .accdb.

Is it possible? How to do it?

Yes it is possible, we and some of our customers  connect to MS Access. Not the most used database, but used.

 

From our user manual:

 

Direct connect to the data base
At least these three parameters must be present for direct connection to a database via ODBC.


DriverID
ODBCDriver
Database

 

image.thumb.png.d82d975a4f1b11deff34a2331f268110.png

 

A DSN can be used and then just a DataSource parameter is needed.  I know it worked when I tested it but, I have never seen a user apply it. All I have seen is the first example and it is what I use.

 

Mark

Edited by Mark-
  • Like 1

Share this post


Link to post
14 hours ago, Mark- said:

Direct connect to the data base
At least these three parameters must be present for direct connection to a database via ODBC.


DriverID
ODBCDriver
Database

Thank you very much, Mark!

 

This is the starting/reference point I needed. It seems I started with wrong DriverID, and thus no chance to make it.

  • Like 1

Share this post


Link to post

We have successfully written a 64bit C++ Builder App that ran on a Windows 10 64 bit OS and talked to an MS Access database.

But you need to use the microsoft 64bit access run time driver package. This cannot exist along side the MS Access program.

So either you have to uninstall MS Access before installing the 64bit driver package or you run the 64 bit application in a virtual

machine with the MS Access *.mdb and other files on a drive that the virtual machine can connect to.

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

×