ACC1x: Error Message Using Access Basic to Import File

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

SYMPTOMS

You receive an "Application Error" message or a general protection (GP) fault when you use Access Basic code to import files into Microsoft Access.

CAUSE

This problem occurs if you use the DoMenuItem action to open the Import dialog box.

RESOLUTION

Use the TransferDatabase, TransferSpreadsheet, or TransferText action instead of the DoMenuItem action.

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

NOTE: This article assumes that you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information on Access Basic, please refer to the "Introduction to Programming" manual.

  1. Create a module with the following line in the Declarations section:

          Option Explicit
    

  2. Create and run the following sample function:

          Function TestImport()
    
             DoCmd DoMenuItem 1,0,5
          End Function
    
    
The error message will occur as soon as you choose the OK button in the Import dialog box.

The following sample function demonstrates how to use the TransferText action to import a Text (Delimited) file:

  1. Create a module with the following line in the Declarations section:

          Option Explicit
    

  2. Create and then run the following sample function:

          Function ImpText()
    
             DoCmd TransferText A_ImportDelim,,"ATABLE","C:\TEST.TXT"
          End Function
    
    

References

Microsoft Access "Language Reference," version 1.1, pages 479-481


Additional query words: gpf transfer text
Keywords : IntpOthr kberrmsg kbinterop PgmHowTo
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 3, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.