The information in this article applies to:
SYMPTOMS
When you try to allocate a huge array, you may receive a general
protection (GP) fault. The following error message appears:
CAUSE
If you have allocated an array element that includes a string or
variant data type and the size of the array exceeds 64K, you may
receive the error message described above, if the following criteria
are met:
RESOLUTIONDeclare the array so that the last data segment contains a different number of elements from the first data segment. STATUSMicrosoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0. MORE INFORMATION
Access Basic has the ability to define huge arrays, larger than the
normal 64K data segment. Any element or index of a huge array may not
extend across the 64K-segment boundary. If all elements of the array
cannot be allocated within the 64K segment, only the elements of the
array that fit evenly in the segment are allocated. Microsoft Access
then allocates another 64K segment to the array and continues to fill
the new segment with the remaining elements.
Example
The size of this structure is 24,012 bytes (3000 * 8 bytes/double + 12 bytes/string). If you declare this array with three elements, you have two data segments, as follows:
In Microsoft Access, you may receive a GP fault if the number of elements in the first segment is equal to the number of elements in the last segment and the data structure used to define the array is made up of either a string or variant data type. If you define the data structure above with six elements, your memory map looks like the following:
The actual dimension statement looks like the following:
To work around this problem, declare the array so that the last data segment does not contain the same number of elements as the first data segment. In addition to the example above, you may choose to define the array with seven elements instead of six. This causes Microsoft Access to allocate four data segments, in which the first data segment contains two elements of the array and the last data segment contains only one element. This example is very easy to duplicate with large data structures, but is more difficult to duplicate with smaller data structures. With an element size of 24,012 bytes, 4, 6, or 8 elements may cause a problem. With a data size of 1K, numbers of elements that duplicate this problem are 128, 192, 256, and so forth. Additional query words: GP fault GPF array
Keywords : kbprg |
Last Reviewed: March 23, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |