INTERNAL ERROR: !dbinsert.cpp@1351: eLockViolation

INTERNAL ERROR: !dbinsert.cpp@1351: eLockViolation

Anonymous
Not applicable
1,728 Views
7 Replies
Message 1 of 8

INTERNAL ERROR: !dbinsert.cpp@1351: eLockViolation

Anonymous
Not applicable

Have not programmed in VBA environment for probably over ten years and last version had VBA built into AutoCAD. Need to update an existing system to run on new Windows 10 64 bit systems running AutoCAD 2018 64 bit. This issue has me stumped. Following is code that can be used to duplicate the issue. Notice that both sub routines are identical. Once the dvb is loaded, you are able to keep running one of the subs over and over again. But as soon as I go and hit the other sub it crashes. Image of error below. This error occurs on all three of my AutoCAD installs 2017, 2018, 2019 and all are 64 bit running on Windows 10 x64. Any thoughts? Thank you!

 

Sub a_001()
    Dim pnt As Variant
    pnt = ThisDrawing.Utility.GetPoint(, "Select: ")
    Dim x As AcadBlockReference
    Set x = ThisDrawing.ModelSpace.InsertBlock(pnt, "C:\???.dwg", 1#, 1#, 1#, 0#)
End Sub
Sub a_002()
    Dim pnt As Variant
    pnt = ThisDrawing.Utility.GetPoint(, "Select: ")
    Dim x As AcadBlockReference
    Set x = ThisDrawing.ModelSpace.InsertBlock(pnt, "C:\???.dwg", 1#, 1#, 1#, 0#)
End Sub

Capture_002.JPG

 

 

 

0 Likes
1,729 Views
7 Replies
Replies (7)
Message 2 of 8

norman.yuan
Mentor
Mentor

I cannot reproduce the error as you claimed.

 

By the way, why do you use "C:\???.dwg" in you sample code as block file name? Do you mean it could be ANY valid DWG file name, or you actually used it to run your code (meaning you have a DWG file with that file name, which should not be possible)?

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 8

Anonymous
Not applicable

@norman.yuanwrote:

I cannot reproduce the error as you claimed.

 

By the way, why do you use "C:\???.dwg" in you sample code as block file name? Do you mean it could be ANY valid DWG file name, or you actually used it to run your code (meaning you have a DWG file with that file name, which should not be possible)?


"C:\???.dwg" means any valid dwg file. 

 

All three machines have installed "AccessDatabaseEngine_X64.exe". Besides installing AutoCAD, AutoCAD VBA Installer, the database engine is the only other install that I did that is common on these three machines. Appreciate you testing it out. At least I know that it in general should just work. If anyone has "AccessDatabaseEngine_X64.exe" and tests the code, please let me know your results. Thanks.

0 Likes
Message 4 of 8

Anonymous
Not applicable

@norman.yuan - FYI, on new testing I just did, I ran the subs from within the VBA IDE and no errors occured. But when I still run the subs from the command line "VBARUN" command, they will fail. So if possible, can you confirm that you run the code on a new instance of AutoCAD and run both subs using "VBARUN" command. Thanks again.

 

 

0 Likes
Message 5 of 8

norman.yuan
Mentor
Mentor

I cannot reproduce it with my AutoCAD2018 and 2019 (Actually Civil3D, but I do not think being plain AutoCAD or Civil3D would make difference here).

 

I tried run it within VBA's IDE (clicking menu "Run") and in AutoCAD editor (entering command VBARUN, or pressing ALT+F8, then in the "Macros" dialog box, select one of the macro and click "Run" button)..

 

So, it is quite strange that you get that error. When you say it occurs to all your AutoCAD 2017, 2018 and 2019, do you mean you have these 3 versions of AutoCAD installed in the same computer? If so, were you able to reproduce it with other computer (well, probably not, or you would not post here)? I only have computers that have AutoCAD 015 and 2018 installed together, and cannot reproduce this issue there. You may want to try to uninstall all of them and reinstall it one by one, if you still need multiple versions of AutoCAD (the older version being installed first).

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 6 of 8

norman.yuan
Mentor
Mentor

I am not sure if the issue have anything to do with installing 64 Access DB Engine. Since I have latest Office 32=bit installed, which prevents 64-bit Access DB Engine to be installed (for Office2010/2013, it seemed possible), I cannot test it by installing 64-Access DB engine. I have abandoned to use Access DB engine long (when starting use of 64-bit AutoCAD) and have never needed it since.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 7 of 8

Anonymous
Not applicable

Up to this point I have installed and tested this on multiple systems, and on all systems the same error happens. The basic specs of four system groups are

 

1. Dell XPS, Windows 7 64-bit, AutoCAD 2015 64-bit (my personal device)

2. Surface Book, Windows 10 64-bit, AutoCAD 2017, 2018, 2019 all 64-bit (my company's device)

3. Surface Book, Windows 10 64-bit, AutoCAD 2019 64-bit (five identical device systems) (a colleague's devices)

4. Custom built Box, Windows 10 64-bit, AutoCAD 2016/17? 64-bit (a co-worker's device) 

 

I agree that the Access DB Engine is not the issue as by this point at least one of the above systems does not have it installed. This is very perplexing. My testing from toolbars or manually running from commandline "vbarun" always fails when I jump back and forth between the two subs without resetting the vba environment.

 

Just tested without causing a crash using the following protocol.......

1. vbaload test_001.dvb

2. vbarun sub a_001

3. vbaunload test_001.dvb

4. vbaload test_001.dvb

5. vbarun sub a_002

 

So for me up to this point on all different computers, one way to not crash is to unload and reload the VBA IDE, and that seems to unlock the internal autocad database process that is happening. Weird....but thanks for trying to help.

 

0 Likes
Message 8 of 8

Anonymous
Not applicable

Another update.....

If before the insert happens on the second sub routine that is run, a regen and save is called, no crash. If only a regen, and if only a save, it will crash. 

0 Likes