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

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 : kberrmsg kbprg
Version : 1.0 1.1
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: March 26, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.