VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA PROBLEMS BETWEEN AUTOCAD 2015 64 bit AND ACCESS 2010 32 bit

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
guidoautelli
9167 Views, 7 Replies

VBA PROBLEMS BETWEEN AUTOCAD 2015 64 bit AND ACCESS 2010 32 bit

Hallo everybody.

I have AUTOCAD 2015 on my PC, running on a WINDOWS 7 PRO 64 bit.

Since 1999 I developed an enormous database, running in ACCESS. Now I still use ACCESS 2010, 32 bit version, because I need use the VB and VBA codes I developed in these years.

Now, I must connect AUTOCAD with ACCESS, but... SURPRISE: it doesn't work!!!

AUTOCAD's VBA let me choose a large number of libraries, but when I click OK it says that there's an error: it can't read some dll (as an example: the DAO360.dll).

These dll are so important, to let me to connect to ACCESS (Tipically: "connection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.....")

Now, I read in many forums and discussions that many people have this problem, and I read too that the only solution proposed is to install the 64 bit version of Microsoft Office... I think this is impossible for thousands people, since everybody wants to use developed codes without spending months and months to rebuild every software and personalization...

So, please, could somebody help me?

How can connect (by VBA) my 64-bit AUTOCAD with my 32-bit ACCESS?

Thanks everybody who'll help me!

 

Guido Autelli

 

 

7 REPLIES 7
Message 2 of 8
norman.yuan
in reply to: guidoautelli

You did not mention, but I assume that your AutoCAD 2015 is 64-bit. That is, your Access DB data access issue is due to AutoCAD being 64-bit, not being 2015.

 

The VBA code in your AutoCAD is now running as 64-bit process since AutoCAD 2014, if the AutoCAD is 64-bit. Prior to AutoCAD 2014, even AutoCAD being 64-bit, its VBA is still 32-bit. So, your existing VBA code is OK with AutoCAD 2013 or older, be it 32 or 64-bit.

 

If you have to use the existing code for AutoCAD 2014 or later without significant update, you need to use 32-bit AutoCAd2014/15.

 

If you have to make your existing code work with 64-bit AutoCAD (2014/15...), then modification/update of some sort is inevetable, depending on your choice of investment you can put into. Here are a few advices I can think of:

 

1. Install 64-bit MS Access data engine, which replaces the older Jet Engine since Access2007. There has been some issues difficulties of doing this.

 

  • If you or some of your uses use Office 2007. It is very likely the office suite is 32-bit. In this case, the 64-bit MS Access Data Engine cannot be installed in the same computer. So, the only option here is to use 64-bit Office 2007, which may open another can of worms..
  •  if you and your users use MS Office 2010 or later (again, it is usually 32-bit suite, as MS recommended, even the computer is 64-bit), then yes, you can install MS Access Data Engine 64-bit. But the 64-bit MS Access Data Engine must be installed prior to MS Office suite (be it with MS Access or not). This is at least true for MS Office 2010. I am not sure for later MS Office, because I no longer dealt with MS Access for quite a while. This could be a troublesome: just because of your AutoCAD need, many of your usersè computers have to get MS office uninstalled for installing MS Access Data Engine 64-bit and then reinstall. Here is a link that may help you:

http://blogs.rand.com/architectural/2011/12/by-joe-eichenseer-how-many-of-you-have-run-into-this-and...

 

This approach should work if the MS Office installed is without MS Access (32). But if the MS Office includes 32-bit Access (which installs MS Access data engine 32-bit), I am not sure if it would break MS Access Data Engine 64-bit. Youèd better try it with a test computer.

 

OK, with MS Access 64-bit Data Engine installed, now you can code data access with ADO2.x (2.8 is the latest) iin 64-bit AutoCAD VBA. I hope your code uses ADO, not DAO (not sure if it works with MS Access Data Engine, DAO is too old technology for me to touch is again in last 10 years). Ièd imagine your data access code may need minor update if you used ADO, at most.

 

However, since AutoCAD VBA is 64-bit, even your data access code works again with MS Access Data Engine 64-bit installed, it does not mean your other VBA Code in AutoCAD also works. If you have complicated UI (user forms) in your AutoCAD VBA code and used some controls/components that are 32-bit only, then your code will still not work and you must replace these controls/components with 64-bit version, which may often not available at all.

 

So, depending on the nature of your Acad VBA app, using MS Access Data Engine 64-bit may solve the data acess issue, but your Acad VBA may still not work with AutoCAD 64-bit VBA.

 

2. Moveing your data to a database server, so that you can code data access in Acad 64-bit VBA without having to depend on MS Access. For example, you can move the data portion of yoru MS Access database into SQL Server (you can use the SQL Server Expresss, whichis free). in this case, you keep your MS Access UI/Code iin MS Access as frontend application, which connect to the SQL Server database. Your MS Access application as fronend may only need very minimum modification. In fact, if your exing MS Access app has been designed well, it is supposed to be split as front and back end already.

 

Again, with this approach, in your AutoCAD VBA side, since it is 64-bit, your existing VBA code may still not work if it uses 32-bit controls/components.

 

3. Forget AutoCAD 64-bit VBA. Due to the lack of support to 64-bit VBA (not many 64-bit controls/components available as with 32-bit), keeping doing VBA development in AutoCAD may not be worth the effort. You may want to start porting AutoCAD application to its .NET API.

 

HTH

Message 3 of 8
guidoautelli
in reply to: norman.yuan

Thank you very much for your help.

I'll try to migrate my database or use a SQL server to connect AUTOCAD.

During this time, I'll use a tip: I'll start an exe from AUTOCAD to let my pc do a lot of operations, by a program I developed separately.

MANY THANKS!!!

 

Guido

Message 4 of 8
tmfieker
in reply to: guidoautelli

Guido, for installing MDAC 64 bits on a computer using Windows 64, Autocad 64 and Office 32 bits follow the below:

 

  • Here's a workaround for installing the 64-bit version of the Microsoft Access Database Engine 2010 redistributable on a system with a 32-bit MS Office version installed:

    • Check the 64-bit registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\FilesPaths" before installing the 64-bit version of the Microsoft Access Database Engine 2010 redistributable.

    • If it does not contain the "mso.dll" registry value, then you will need to rename or delete the value after installing the 64-bit version of the Microsoft Access Database Engine 2010 redistributable on a system with a 32-bit version of MS Office installed.

    • Use the "/passive" command line parameter to install the redistributable, e.g. "C:\directory path\AccessDatabaseEngine_x64.exe" /passive

    • Delete or rename the "mso.dll" registry value, which contains the path to the 64-bit version of MSO.DLL (and should not be used by 32-bit MS Office versions).

    • Now you can start a 32-bit MS Office application without the "re-configuring" issue.

      Note that the "mso.dll" registry value will already be present if a 64-bit version of MS Office is installed. In this case the value should not be deleted or renamed.

Message 5 of 8
MRiemenCAD
in reply to: norman.yuan

Interesting. I've run into this issue when working with .Net applications however i've had VBA connected via my 64bit ACAD 2012 to a 32bit Access office installation on the same machine and it works fine. Now i'm trying to connect my ACAD 2015 via the same references to the same database and it won't allow it. Seems like there's finally a wall between the two that didn't exist previously.

 

Is this ADSK trying to push us all out of VBA once and for all? 

Message 6 of 8
tmfieker
in reply to: MRiemenCAD

Are you using the connection string below?
ConnectionString:="Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source="c:\xxxx\yyyy.accdb";Jet OLEDB:Database Password=????;"

 

 

Message 7 of 8
guidoautelli
in reply to: tmfieker

Hallo!

I tried every method, but it doesn't runs.

Particularly, after using your proposal, I'm havin a great problem with Outlook: it dosen't read the register!!!

So, now I can't create new folders... 

 

May you help me???

 

Guido

Message 8 of 8
MRiemenCAD
in reply to: tmfieker

Worked great. Thanks for the help.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost