Macros and Programming


CardboxForumsMacros and Programming > "Cardbox fatal error when running macro"

Cardbox fatal error when running macro

Posted By Post


7-Mar-2013 11:11

Hi everyone

I wonder if you can help me please. I have a quite involved macro that works the majority of the time.

It sets a number of fields as variables and checks certain conditions are met and then saves fixed text panels to fields, selects a screen preview format, waits for user confirmation and then changes to a print format and prints using a PDF generator.

Occasionally, I get the error message 'Cardbox has encountered a fatal error and needs to close'.
The error log says 'ACCESS VIOLATION'.

Alongside Cardbox we use a web syncronisation program which pushes/pulls details from our sql database so this macro adds the date to the changed field so syncronisation happens. To store the new variables which are created by the macro we use rec.Edit and rec.Save

I'm guessing this error may be that somehow the users PC and our server which runs the sync program are somehow both editing the record at the same time.

Does anyone have any ideas?

Many thanks


16:56:27.416 S_RECORDS_ADDED(+347744), length=10
16:57:44.414 RealPrintCommand::AbortProc called
16:57:44.664 RealPrintCommand::AbortProc called
16:59:46.036 //- Start of Exception Report ------------------------
16:59:46.036 Crashing thread is 0001CA00: Main
16:59:46.036 CS:EIP=001B:0000004C SS:ESP=0023:0012FBEC EBP=0012FC54 Flags=00010286
16:59:46.036 EAX=020F9FD0 EBX=013E22E8 ECX=0209B608 EDX=E4212C2E ESI=0209B608 EDI=00000000
16:59:46.036 DS=0023 ES=0023 FS=003B GS=0000
16:59:46.036 Exception code: C0000005 ACCESS_VIOLATION
16:59:46.036 Fault address: 0000004C 7C910323:00000034
16:59:46.036 0012FBE0: 004E3EB8
16:59:46.036 0012FBF0: 0209B608 005450F8 0209B608 00545065
16:59:46.036 0012FC00: 00000000 020AA7F0 022017F0 0000009C
16:59:46.036 0012FC10: 00000000 7C9131DF 00000000 01550678
16:59:46.036 0012FC20: 00000000 00000000 00000000 7C80FFCD
16:59:46.036 0012FC30: 0306ED7C 00000000 021679C8 00000001
16:59:46.036 0012FC40: 00000000 00000000 0012FCEC 006D6398
16:59:46.036 0012FC50: 00000000
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 0000004C 0012FC54 0000:00000000
16:59:46.036 0012FC50: 0012FC5C 00544F53
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 00544F53 0012FC5C 0001:00143F53 X:\cardbox3.exe
16:59:46.036 0012FC50: 0012FC6C
16:59:46.036 0012FC60: 00544F33 00000002 00000000
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 00544F33 0012FC6C 0001:00143F33 X:\cardbox3.exe
16:59:46.036 0012FC60: 0012FC90
16:59:46.036 0012FC70: 00452DA0 0209B608 00000002 00000000
16:59:46.036 0012FC80: 019445D0 020AA7F0 0000024F 00000000
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 00452DA0 0012FC90 0001:00051DA0 X:\cardbox3.exe
16:59:46.036 0012FC90: 0012FCAC 0056D605 00000002 00000000
16:59:46.036 0012FCA0: 020AA7F0 013E33B8 019445D0
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 0056D605 0012FCAC 0001:0016C605 X:\cardbox3.exe
16:59:46.036 0012FCA0: 0012FCF8
16:59:46.036 0012FCB0: 0044F8E1 00002374 019445D0 00000040
16:59:46.036 0012FCC0: 019445D0 013E22E8 0012FDF8 7C90E920
16:59:46.036 0012FCD0: 7C910060 FFFFFFFF 7C91005D 005BC53D
16:59:46.036 0012FCE0: 013E0000 00000040 019445D0 0012FDF8
16:59:46.036 0012FCF0: 006CFE98 FFFFFFFF
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 0044F8E1 0012FCF8 0001:0004E8E1 X:\cardbox3.exe
16:59:46.036 0012FCF0: 0012FD18 0044FC3B
16:59:46.036 0012FD00: 00002374 019445D0 013E22E8 019445D0
16:59:46.036 0012FD10: 013E3440 013E22E8
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 0044FC3B 0012FD18 0001:0004EC3B X:\cardbox3.exe
16:59:46.036 0012FD10: 0012FD38 005730BE
16:59:46.036 0012FD20: 0000D2FF 01330348 013E22E8 00000000
16:59:46.036 0012FD30: 7E419491 01330348
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 005730BE 0012FD38 0001:001720BE X:\cardbox3.exe
16:59:46.036 0012FD30: 0012FD50 00573017
16:59:46.036 0012FD40: 00000000 013E22E8 0012FDF8 7E44048F
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 00573017 0012FD50 0001:00172017 X:\cardbox3.exe
16:59:46.036 0012FD50: 0012FD74 00572F6D 01330348 00000404
16:59:46.036 0012FD60: 00000000 00000000 0012FDDC 00572F00
16:59:46.036 0012FD70: 00000000
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 00572F6D 0012FD74 0001:00171F6D X:\cardbox3.exe
16:59:46.036 0012FD70: 0012FDA0 7E418734 01330348
16:59:46.036 0012FD80: 00000404 00000000 00000000 00572F00
16:59:46.036 0012FD90: DCBAABCD 00000000 0012FDDC 00572F00
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 7E418734 0012FDA0 0001:00007734 C:\WINDOWS\system32\USER32.dll
16:59:46.036 0012FDA0: 0012FE08 7E418816 00572F00 01330348
16:59:46.036 0012FDB0: 00000404 00000000 00000000 0012FEA8
16:59:46.036 0012FDC0: 0012FEA0 010C6F78 00000014 00000001
16:59:46.036 0012FDD0: 00000000 00000000 00000010 00000000
16:59:46.036 0012FDE0: 01330348 00000001 00000000 00000000
16:59:46.036 0012FDF0: 0012FDBC 0012F810 0012FE58 7E44048F
16:59:46.036 0012FE00: 7E418830 00000000
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 7E418816 0012FE08 0001:00007816 C:\WINDOWS\system32\USER32.dll
16:59:46.036 0012FE00: 0012FE68 7E4189CD
16:59:46.036 0012FE10: 00000000 00572F00 01330348 00000404
16:59:46.036 0012FE20: 00000000 00000000 010C6F8C 00000001
16:59:46.036 0012FE30: 7E429313 0012FEA0 7FFD7000 00000001
16:59:46.036 0012FE40: 7E429313 0012FEA0 00000000 00000000
16:59:46.036 0012FE50: 0012FE30 0012F810 0012FEE4 7E44048F
16:59:46.036 0012FE60: 7E4189F0 FFFFFFFF
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 7E4189CD 0012FE68 0001:000079CD C:\WINDOWS\system32\USER32.dll
16:59:46.036 0012FE60: 0012FE78 7E4196C7
16:59:46.036 0012FE70: 0012FEA0 00000001
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 7E4196C7 0012FE78 0001:000086C7 C:\WINDOWS\system32\USER32.dll
16:59:46.036 0012FE70: 0012FE8C 00600E1B
16:59:46.036 0012FE80: 0012FEA0 7E41940C 7E42F3C2
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 00600E1B 0012FE8C 0001:001FFE1B X:\cardbox3.exe
16:59:46.036 0012FE80: 0012FEF0
16:59:46.036 0012FE90: 005CD3A2 0012FEA0 80000001 00000000
16:59:46.036 0012FEA0: 01330348 00000404 00000000 00000000
16:59:46.036 0012FEB0: 487BDF39 000003A6 000002C4 00000000
16:59:46.036 0012FEC0: 013E1FD8 00000001 0001CA00 00000000
16:59:46.036 0012FED0: 013E21E0 00000001 00000000 013E2258
16:59:46.036 0012FEE0: 00000001 0012FF24 006DAC68 00000000
16:59:46.036 Address Frame Logical addr Module
16:59:46.036 005CD3A2 0012FEF0 0001:001CC3A2 X:\cardbox3.exe
16:59:46.036 0012FEF0: 0012FF34 005CCE3B 00400000 00000000
16:59:46.036 0012FF00: 00152322 00000001 80000001 00000000
16:59:46.036 0012FF10: 7FFD7000 7FFD7000 007543C4 0012FF08
16:59:46.036 0012FF20: 0012F810 0012FFB0 006BB47C 0072D638
16:59:46.036 0012FF30: 00000000
16:59:46.036 //= End of Exception Report ===========================
16:59:46.036 Cardbox will now halt.

Charles Welling

7-Mar-2013 12:36

I've got the same thing and not only when running macros. It only occurs however on our terminal server (Win2008, 64bit). All other systems run fine.
I'm convinced it has nothing to do with Cardbox, because all software running on that terminal server shows the same behaviour, i.e. unexpected and random termination.


7-Mar-2013 13:29

Thanks for the reply Charles, this is only happening for me when I run this macro. The strange thing is I can re-open cardbox and run the same macro with the exact same data and get no error.

We also run 2K8, 64 bit on our server and don't have any problems there though if that helps!


7-Mar-2013 16:05

Sometimes, long time ago, I also met this in a macro.
This solved this:
- sometimes it helps to exchange some macro commands if possible
- sometimes it is necessary (always better!) to reset used objects at the end of a macro. Windows does not always clean up certain objects very fast of itself.
- sometime even reset (some) objects which a used in a loop (set objname = nothing).
I hope this will give you a solution. It helped me to get rid of these messages.


21-Mar-2013 09:43

Is it possible to get any official help from the Cardbox guys now there are no support subscriptions? I'm pretty stuck with this now.

Thanks :)


21-Mar-2013 22:44

Did you do what Cardbox asked you to do when it crashed?
Did you send your logfile your support@Cardbox.com?
If yes: what was the answer?

I wrote you before that this error can caused by your macro code.
If you want solution suggestions for that: send also the code and tell us on what line the crash happens...?
Perhaps this information can raise more suggestions for finding a solution.



22-Mar-2013 09:26

Hi Bert

I didn't send the log to Cardbox as support is no longer sold and our subscription has expired.

On the webpage re support subsciptions it says if you need help try the forums.

If sending to Cardbox is possible, of course I will do this.

The macro is 1700 lines long and it doesn't crash on a line... it does everything it should do and then comes up with Cardbox has encountered a fatal error and needs to close.

Thanks for your help.

Charles Welling

22-Mar-2013 11:16

Having read your post, I started Cardbox and guess what? It crashed when I tried to open a database. I wrote to you before that it does not only happen when you run macros, and it does not only happen to Cardbox. In my case the logs always contain the line:

12:08:43.177 Exception code: C0000005 ACCESS_VIOLATION

as does your log.

I think it has no use going through your macro code. You will not find anything wrong there.


22-Mar-2013 11:47

First 3 lines of the report says two things I think:
- You added records
- RealPrintCommand: that seems to indicate there someting going wrong with the PDF creation printerdriver.

Some thoughts:
- Is Cardbox ready adding the records when you the print command is done? So, reset the rec object before the print command (and other not used objects), for just in case...
- Perhaps it is an idea to try another pdf printer en see if there is a difference?
- Is on the print format a specific printer connected which does not exist any more? In specific moments that can generate problems (communication between Windows printer information and Cardbox is sometimes a little slow which can generate delay with unpredictable results).

I use for printing PDF's a PDF generator with scripting possibilities. It's cheap, and you can print using a macro. All needed settings - file name etc - you can enter in registry keys. Never met problems with it (PDFCamp) and no user-interaction needed.

Btw: also Cardboss is a member of this forum...


© 2010 Cardbox Software Limited   Home