ACC1x: GP Fault When Passing User-Defined Type with Array

Last reviewed: June 8, 1997
Article ID: Q105647
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SYMPTOMS

You get the error message "MSACCESS caused a General Protection Fault (GP Fault) in module MSABC110.DLL at 000D:1AD4" when you attempt to pass a user-defined type to a function or Sub procedure in which one of the components of the user-defined type is an array.

This happens only under the following conditions:

  • The user-defined type contains an array.
  • You attempt to pass an array element of the user-defined type to a Sub procedure or function.

RESOLUTION

A workaround for Microsoft Access version 1.1 is to explicitly cast the data type of the array. For the example below, instead of

   Call GPFTest(Testing.StrArry())

you would explicitly cast the array as a string array by placing the "$" character at the end of the array reference, such as:

   Call GPFTest(Testing.StrArry$())

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

  1. Start Microsoft Access and create a new database and module.

  2. In the Declarations section of the module, type the following:

          Type TestType
    
              StrArry(10) as String
          End Type
          Dim Testing as TestType
    
    

  3. Create a Sub procedure called Start as follows:

          Sub Start()
             Testing.StrArry(1) = ""
             Call GPFTest(Testing.StrArry())
          End Sub
    
    

  4. Create a Sub procedure called GPFTest as follows:

          Sub GPFTest(Testing() as String)
             For x=1 to 10
                Debug.Print Testing(x)   ' This line causes a GP Fault.
             Next
          End Sub
    
    

  5. Start the code by running the Sub Start() function. To do this, give the focus to the Immediate window, type "Start," and press ENTER.

    You get the following error message:

          MSACCESS caused a General Protection Fault in module
          MSABC110.DLL at 000D:1AD4
    


Additional query words: Programming GPF
Keywords : EvnGpf kberrmsg kbprg PgmDecl PgmOthr
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


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: June 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.