Microsoft KB Archive/100168

{|
 * width="100%"|

PRA: GP Fault When Using Erase Statement on String Array
'Article ID: Q100168

Creation Date: 16-JUN-1993

Revision Date: 19-SEP-1996' The information in this article applies to:


 * Microsoft Access versions 1.0 and 1.1

SYMPTOMS

When you use an Erase statement on a string array, you receive a general protection (GP) fault. The following error message appears:

An error has occurred in your application. If you choose Ignore, you should save your work in a new file. If you choose Close, your application will terminate. CAUSE

You are trying to use the Erase statement on a string array contained in a user-defined data type.

RESOLUTION

Use a loop structure to initialize the string array in the data type.

STATUS

Microsoft 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

Steps to Reproduce Problem

The following code generates the error message described above:

Type Foosball X(1) As String End Type

Sub Main Dim Arrays As Foosball Erase Arrays.X  End Sub To work around this problem, use the following loop structure instead of the Erase statement: Sub Main Dim Arrays As Foosball For i = 1 To UBound(Arrays.X)        Arrays.X(i) = "" Next i  End Sub
 * }

-

"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." '' ©1997 Microsoft Corporation. All rights reserved. Legal Notices.

''

Additional reference words: 1.00 1.10 loop construct Erase structure

KBCategory: kbprg

KBSubcategory: PgmOthr