PDA

View Full Version : Trying to open an Acess Database from Word VBA code fails



Bo Hansson
11-02-2017, 01:03 PM
I am running Windows 10 and a Word VBA application in Word 2016/64-bit.


Following code line results in error message: "ActiveX component can't create object or return reference to this object (Error 429)"

Set dbsData = OpenDatabase(strPath & "Database\Lotta 2000.mdb")

What's the problem?

macropod
11-02-2017, 08:18 PM
We'd need to know a lot more about your code before specific advice could be given. One fairly obvious question is whether whatever you're populating strPath with terminates in a '\' - assuming 'Database' is a folder in its own right.

Bo Hansson
11-03-2017, 01:51 AM
My application has worked OK for many years, but suddenly I got this problem. Among the references there is a "Microsoft DAO 3.6", located in "C:\Program (x86)\Common Files\Microsoft Shared\DAO\dao360.dll"
So, from my point of view everything seems to be OK!?

macropod
11-03-2017, 04:18 AM
Did you try re-starting your system? Have you tried repairing the Office installation (via Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change > Repair)?

Bo Hansson
11-03-2017, 05:06 AM
Did you try re-starting your system? Have you tried repairing the Office installation (via Windows Control Panel > Programs > Programs & Features > Microsoft Office (version) > Change > Repair)?


Have done both, buit still the same problem!

macropod
11-03-2017, 05:15 AM
You haven't answered the question posed in my first post...

Furthermore, you say you're using Word 2016/64-bit, but I doubt that would use libraries in C:\Programs (x86)\, since anything there is a 32-bit library.

Bo Hansson
11-03-2017, 06:07 AM
Well, my strPath ends with "\" and Database is a folder containing the Access Database.

I also have another path to DAO 3.6: "C:\Programs\..." containing the same dll file, but the references inm the VBA editor points to "C:\Programs (x86)\..."