Knowledgebase: Microsoft Products
[QODBC-Desktop] Troubleshooting - Runtime error (28) when using Windows XP, but not Windows 2000.
Posted by Jack - QODBC Support on 04 January 2017 10:48 AM

Troubleshooting - Runtime error (28) when using Windows XP, but not Windows 2000.

Problem Description:

We have four machines using the ODBC driver with QuickBooks and Access 2003 that work perfectly fine. The odd machine is a slightly higher version of Access to Windows XP and gets hung up when processing a query. With QuickBooks help, I have tested the ODBC driver on the XP machine and it runs a test query fine. It is only when Access 2003 enters into the mix that it does not work. All machines are pulling from the same database.

Any ideas would be great.

Solution:

This sounds like an "Out of Stack Space" error when running a Sub Procedure in Access 2003. When you run a Visual Basic Sub procedure that calls another procedure, you may receive the following error message:

Run-time error '28':
Out of stack space

CAUSE
This error message appears when one procedure in your module calls another procedure, and that procedure calls another procedure, and so on. The error message occurs in this case because when you call one sub procedure from another procedure, the first procedure is not unloaded from memory until the procedure that it called is finished. Because of this behavior, if you continue to call a procedure from another procedure, you may run out of stack space, or memory allotted for the macro before the last procedure is called.

WORKAROUND
To work around this problem, call individual sub-procedures from one main procedure, instead of calling one sub procedure from another sub procedure, and so on. For example, if you are calling sub-procedures as in the following example

   Sub one()
      two
   End Sub

   Sub two()
      three
   End Sub

   Sub three()
      four
   End Sub
  
You can call these sub-procedures from the first procedure as in the following example:   

   Sub Main()
      one
      two
      three
      four
   End Sub 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).