Microsoft word 2010 64bit VBA code when connecting to access database 2010 64bit activex error

601 Views Asked by At

Im trying to display records from my access 2010 64 bit database into word footer, when I run the code I get ActiveX can not create object. I do have reference in my vba project microsoft dao 3.6 object library and microsoft activex data objects 6.1 libraries. The code is working fine on 32bit but not 64 bit. Any ideas? Debug pointing to this line as error:

Set dataBase = DBEngine.OpenDatabase(UsersBasePath)
1

There are 1 best solutions below

1
On

I had to add dao in the front of the database declaring statement