Visual Basic Customization

Visual Basic Customization

Reply
Member
robert.platt
Posts: 5
Registered: ‎09-16-2013
Message 1 of 3 (1,445 Views)

AutoCAD 2014, VBA, and MS Access 2013

1445 Views, 2 Replies
09-16-2013 10:59 PM

Good morning experts!

Picking up on the on going discussion re VBA 7 and AutoCAD 2014, I'm having issues with links between AutoCAD 2014 and MS Access 2013.

These links worked fine in my previous configuration (AutoCAD 2013 and Access 2010 - AutoCAD was 64bit and Access was 32 bit, and I was using VBA 6)

Can anyone tell me if this is simply an issue relating to 32bit VBA vs 64bit VBA 7, or are there changes in the way MS Access works as well.

More significantly can the issue be fixed, or does this mean I'm going to have to bite the bullet and change to VB.net?

Many thanks in advance.

Robert

*Expert Elite*
norman.yuan
Posts: 1,014
Registered: ‎04-27-2009
Message 2 of 3 (1,426 Views)

Re: AutoCAD 2014, VBA, and MS Access 2013

09-17-2013 06:45 AM in reply to: robert.platt

What is the "link between" AutoCAD and MS Access DB you mentioned? Yes, it is very likely because of the 32-bit and 64-bit issue.

 

Prior to AutoCAD 2014, even the AutoCAD itself is 64-bit, its VBA is still 32-bit. So, if your "link" means connection to Access DB created in VBA by your VBA code, then, yes, you can connect to 32-bit Access DB with AutoCAD VBA, (but 64-bit AutoCAD itself cannot directly connect to 32-bit Access DB with DataLink).

 

With AutoCAD 2014, if you use 64-bit AutoCAD, the VBA is now also 64-bit, therefore, if you want to connect with VBA code, the Access DB must also be 64-bit.

 

Depending on the complexity of your VBA project, moving current 32-bit VBA code into 64-bit VBA may or may not be an easy/straigntforward thing to do. And yes, migrating to .NET API might be better option in long term. In the between, moving data to a server type of DB, rather than use file based DB, such as Access DB might solve your immediate 32/64-bit issue with minimum code change (also depending on how you did the code of data access).

 

Member
robert.platt
Posts: 5
Registered: ‎09-16-2013
Message 3 of 3 (1,421 Views)

Re: AutoCAD 2014, VBA, and MS Access 2013

09-17-2013 08:46 AM in reply to: norman.yuan
Hi Norman, and thanks for the quick and comprehensive reply.
I am using VBA to insert and populate blocks in a drawing, and then I use the VBA to extract attribute data from the blocks into an Access database. I can then interrogate the drawing using the database data. The VBA programme is also set up so that I can make changes in the drawing and update the database all from within AutoCAD.
Ideally I'd obviously like to hang onto all the code I've written, mainly because it does exactly what I need it to do.
Thanks again.
Robert
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.