Plugin crash

Plugin crash

kstate92
Collaborator Collaborator
1,487 Views
6 Replies
Message 1 of 7

Plugin crash

kstate92
Collaborator
Collaborator

I've developed a plugin using VB.Net Framework 4.6 that pulls info from an Access database (using OleDb 12 via the x64 Engine passively installed) and creates and places attributed blocks in the active AutoCAD drawing.  It works on my computer but does not on another users'.  It appears to crash during the initial connection to the database, resulting in two crash error dialogs (one from the app form and AutoCAD itself, I'm guessing), but no warnings or error information to give me a clue as where to start.

 

Our AutoCAD Mechanical 2017 installs are at the same, most up to date levels.  The only difference I can think of is I'm on Office 2007 and they're on 2010 (both 32 bit).  I did submit the CERs and wrote the last number down but have not received any responses back from Autodesk, not that I'm demanding one.  I suppose I should have Office 2010 installed on my box just to match and maybe catch a subtle error within Studio while debugging.  But I suspect I'll have to uninstall the X64 Access 2010 engine first and then reinstall it, though I'm a bit hesitant as I don't want to end up with the plugin not working with 2010 and no workaround available.  We're all running Windows 7 64bit.

 

Just curious if anyone had any advice.

KState92
Inventor Professional 2020
AutoCAD Mechanical 2022.0.1
Windows 10 Pro 64 bit - 1903
Core i7-8700 32 GB Ram
Quadro P2000
0 Likes
1,488 Views
6 Replies
Replies (6)
Message 2 of 7

norman.yuan
Mentor
Mentor

With the current state of technologies related to AutoCAD use, using Access Database for data storage would be possibly the worst among many viable choices, IMO, especially when the CAD computer has 64-bit AutoCAD but also stuck with old MS Office suite (2007 and 2010).

 

It looks like you have already figured out how to painfully get Access DB Engine installed in computer with Office 2007 (uninstall Office, if it somehow already there; install Access DB engine 64-bit; reinstall Office suite back; and if the Office suite must include MS Access and is 32-bit, then you cannot install Access DB Engine 64-bit...what a burden!). Also. good for you that you were able to make things a bit easier by install Access DB Engine in "passive" mode, which may not be succeed with newer Office version: I tried with my Office 2016 installed computer without success a while ago.

 

From your description, it is difficult to say where the problem could be. Reporting the error to Autodesk would not help at all, because it is your own code causes the error, and most likely related to the use of Access DB Engine for accessing data in *.mdb/*.accdb file. You should take advantage of .NET language's structured exception handling (try...catch...) to catch as much as possible exceptions, so that you can easier to tell where the exception comes from.

 

Another way to tell, at least, whether the Access DB Engine is installed and works or not, is to use "Control Panel->Administrative Tools->Data Sources". Then try to create an ODBC data source that connects to an *.mdb/*.accdb file. During the process, you should be able to select MS Access DB Engine as provider and eventually test if the data source connection is OK or not. If you cannot succeed creating the data source, that means the Access DB Engine is not installed, or not installed correctly, hence your AutoCAD plugin does not work.

 

Again, as I said, at current time, using Access DB Engine is the worst one among many choices. If you want to have shared data storage, you can use free SQLServer Express (or other DB server, such as MySql...), if the data is for single computer use, you could use file-based SqlLite...If your data access code written with ADO.NET well enough, it is fairly easy to switch data from Access DB into, say, SqlServer(Express), with only minor code change.

 

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 7

dgorsman
Consultant
Consultant

SQL Server and similar have a lot of overhead for management, as well as potentially having to fight IT for various access rights, setting it up on the server, and so on.  Not that Access is always the best choice either, as it's overkill for relatively small amounts of data (which may be better served by XML or even CSV) and is vulnerable to IT applying system updates or upgrading to a newer version.  But Access is still a decent choice for that middle ground where you need a file-based, network-located, query-able database which may have additional links to Excel or other systems.

 

From experience, Office 2010 x32 doesn't play nice with the x64 Access engine.  Later versions of Office using the ACE OLEDB connection work better.  But I'd recommend installing the x64 version of Office for CAD users so there isn't any buggering around.

 

Yes, there's "recommendations" out there that no one uses x64 Office.  Those are based on a "white paper" which only points out that there may not be x64 versions of custom controls, so previous customizations may not work.  It does *not* recommend against using x64 Office.  We've been using x64 Office (on both CAD and non-CAD computers) for some time.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 4 of 7

kstate92
Collaborator
Collaborator

Thru the Control Panel / ODBC driver configure test, I get what is described here:

 

ODBC-driver-for-Microsoft-Access-installation-problem

 

I don't get this error on my computer.  I did another install of the x64 engine and sp1 as described, but no change at the CP or running the plugin in AutoCAD.  Oddly, I didn't have to delete the mso registry entry after the second install.

 

Years ago, I'd asked IT about setting up an SQL server; they were less than excited.  They did have a point as they, I, nor anyone else here are familiar with upkeep, replication, backup, etc.

 

The root of the problem of course, is a very old custom program (install instructions include a section for Windows 95) written in VB6 that writes to the same mdb file I'm connecting to.  We do have the source code (I imported into Studio Express once, maxing-out the number of reportable errors) and I suppose we could hire a programmer to upgrade it for us, but I'm betting the quote would be in the five-figure range, given the complexity of the program.

 

In just re-reading this Autodesk page that does mention 2010 (and 2013) 32-bit Office, I'm not sure why this isn't working:

How-to-install-64-bit-Microsoft-Database-Drivers-alongside-32-bit-Microsoft-Office

 

 

KState92
Inventor Professional 2020
AutoCAD Mechanical 2022.0.1
Windows 10 Pro 64 bit - 1903
Core i7-8700 32 GB Ram
Quadro P2000
0 Likes
Message 5 of 7

kstate92
Collaborator
Collaborator

I stumbled across a suggestion mentioning the odbcji32 error (oddly, another Autodesk link: Error-Unable-to-load-odbcji32-dll-when-launching-Advance-Steel.html) to run a repair on the Access Engine install.  I ran the repair, fixed the mso registry entry (renaming this time instead of deleting it) and then opened the ODBC Control Panel. I was able to pull up the Configure option for the Access driver without the prior error.  I then started AutoCAD 2017 and ran my plug-in without it crashing.

 

I am a little concerned as I had this all set up before and then got blind-sided by this error, making me wonder about the durability of this admittedly legacy band-aid.

KState92
Inventor Professional 2020
AutoCAD Mechanical 2022.0.1
Windows 10 Pro 64 bit - 1903
Core i7-8700 32 GB Ram
Quadro P2000
0 Likes
Message 6 of 7

norman.yuan
Mentor
Mentor

If you insist on using, or have to stick with, Access database, your best bet to avoid the hustle of installing 64-bit Access DB Engine (because AutoCAD VBA is 64-bit, assuming using 32-bit AutoCAD is not an option) is to use 64-bit MS Office suite (or not us MS Office application at all. again, probably not an option), as @dgorsman suggested.

 

That is, choose one from these 2 options: all users have 64-bit MS Office apps; or do not use Access database with your AutoCAD app.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 7 of 7

kstate92
Collaborator
Collaborator

We do have to stick with Access and 32-bit at that.  At the heart of this is a custom BOM creation and task management program written long ago in VB6 and storing all the data in an mdb file via 32-bit Jet.  A problem of our own creation I know.  A classic example of two phrases linked together: "If it ain't broke, don't fix [upgrade] it." and "Time flies".

 

Our first order of business was transitioning to an AutoCAD version we're subscribed to (2017 and Win 7 for a hardware issue) while still retaining this core function we need.  Then we can look at finally upgrading our BOM / task program to something more modern and maybe better integrated with our MRP system.  Plus, Windows 10 is coming soon too.

 

KState92
Inventor Professional 2020
AutoCAD Mechanical 2022.0.1
Windows 10 Pro 64 bit - 1903
Core i7-8700 32 GB Ram
Quadro P2000
0 Likes