ACC: Global Variable Limitations - Exceeds 64K Segment

Last reviewed: August 28, 1997
Article ID: Q141614
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0, 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

Depending on how variables are declared in Microsoft Access 2.0, they can either end up in the Stack (approximately 64 kilobyte (K) limit) or on the Heap. When declaring variables as either Global or fixed-length strings, the error message "Out of Memory" will occur if a 64K memory segment limit is encountered. This is a cumulative total. In other words, the size of variable X plus the size of variable Y cannot exceed the approximate 64K limit.

When declaring variables in Microsoft Access 7.0 and 97, they contain an approximate 64K limit per fixed-length string, regardless of how the variables are dimensioned (local or global). The error message "Invalid length for fixed-length string" will occur if a fixed-length string exceeds the approximate 64K limit. This is not a cumulative total. In other words, variable X and variable Y can each be approximately 64K in size. The actual size allowed per fixed-length string in Microsoft Access 7.0 and 97 is 65,526 bytes.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a module and type the followings line in the Declarations section:

          Option Explicit
          Global x as String * 66000
    

          ' NOTE: In Microsoft Access 2.0, the amount of the declarations are
          ' cumulative. The error can be caused by these three Global
          ' statements which exceed the limit when added together.
    

          Option Explicit
          Global x as String * 30000
          Global y as String * 30000
          Global z as String * 30000
    

Threshold will vary on each individual system. It Microsoft Access 2.0, it is also possible to impact this threshold by unloading some of the wizards in the [Library] section of the MSACC20.INI file.

STATUS

This behavior is by design.


Additional query words: code
Keywords : kberrmsg kbprg PgmDecl PgmOthr
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb
Solution Type : kbcode


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.