Hello, this is my first post so bear with me if it is too lengthy or incorrect in some other manner.
I have an Access XP (ADP) application that is connected to a MS SQL server (workgroup) over a Windows Small Business server (2003).
This Access ADP collects sales data for the current month and groups it into invoices. This ADP then connects to a third party DB/accounting software (Simply Accounting By Sage) and exports the invoices into Simply (usually 500 to 1000 invoices in total). All data that is passed to Simply Accounting must be passed as byte data to Custom APIs (dll) supplied by Simply Accounting. As a result I heavily use the following windows API to create the byte data:
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
MY PROBLEM:
This ADP unexpectedly crashes at different points in the code that exports these invoices. The following is the error given in the Application Event Log:
Faulting application msaccess.exe, version 12.0.6211.1000, stamp 46d4aa81, faulting module ntdll.dll, version 5.1.2600.2180, stamp 411096b4, debug? 0, fault address 0x0000316c.
I have found a terrible work around. If I Pause the code every 20th invoice, this procedure will work 90% of the time. I pause the code for 2 seconds with the following:
Sub Wait(dblSeconds As Double)
For i = 1 To dblSeconds * 100
DoEvents ' handle events
Sleep (10) ' suspend process without CPU-Load
Next
End Sub
However, 90% working is not good enough for deployment. I need to fix this.
ATTEMPTED SOLUTIONS:
- I have tried inserting the office disk and repairing, that did not work.
-I have tried moving all files to a local machine, so the network is not involved it still breaks,
- If I comment out all of the calls to the windows API CopyMemory,
Can you call APIs too quickly, or too often? I am quite sure the issue is with the windows api RtlMoveMemory but I am not sure how to fix it.
Start Free Trial