ACC1x: Run-Time Error Occurs Calling Financial Functions

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

SYMPTOMS

When you are calling financial functions, the following error message occurs:

   A run-time error occurred in database: UTILITY. You don't have
   permissions to view modules in this database.

CAUSE

Although each function defined in the library has error trapping enabled, the declaration for the SetUserError() subroutine does not point to the correct dynamic link library (DLL).

RESOLUTION

You must change the UTILITY.MDA file using the procedure listed below. This change will correct the declaration for the SetUserError() subroutine, causing it to point to the correct DLL.

STATUS

This problem no longer occurs in Microsoft Access version 2.0.

MORE INFORMATION

Steps to Reproduce Problem

In any module's Immediate window, run the following function by typing:

   ? Rate(27,5495,277512,189000,1,0.1)

You will receive the error message stated in the SYMPTOMS section.

Steps to Correct Problem

  1. From the File menu, choose New Database to create a new, empty database. Type "junk.mdb" (without the quotation marks) in the File Name text box and choose OK.

  2. Close all instances of Microsoft Access.

  3. Open the MSACCESS.INI file located in the Windows directory using any text editor. (For example, use the Microsoft Windows Notepad text editor.)

  4. In the MSACCESS.INI file, locate the [OPTIONS] section. Comment out the UtilityDB line by placing a semicolon (;) at the beginning of the line.

  5. Add a new line to specify a new utility database called JUNK.MDB. The MSACCESS.INI file should now look like the following:

    NOTE: The drive and pathnames in your MSACCESS.INI file may differ from those listed in the example below.

    [Options] ;UtilityDB=D:\ACCESS.110\UTILITY.MDA UtilityDB=D:\ACCESS.110\JUNK.MDB

  6. Save the changes to the MSACCESS.INI file and close the text editor.

  7. Open Microsoft Access.

  8. From the File menu, choose Open Database. Type "utility.mda" (without the quotation marks) in the File Name text box and choose OK.

  9. You may receive error messages. Bypass these messages and continue.

  10. Open the Finance module.

  11. Change the following line

    Declare Sub SetUserError Lib "MSABC100.DLL" (ByVal ErrCode As _

                       Integer)
    
        to:
    
        Declare Sub SetUserError Lib "MSABC110.DLL" (ByVal ErrCode As _
                       Integer)
    
        NOTE: In the declaration above, the underscore (_) is used as a
        line-continuation character to improve readability. Your code will
        appear on a single line without the underscore.
    
    

  12. Save the changes to the Finance module. Close Microsoft Access.

  13. Return the MSACCESS.INI file back to its original settings. The file should read:

    NOTE: The drive and pathnames in your MSACCESS.INI file may differ from those listed in the example below.

    [Options] UtilityDB=D:\ACCESS.110\UTILITY.MDA

  14. Save the changes to the MSACCESS.INI file and close the text editor.


Keywords : kberrmsg kbprg MdlLib
Version : 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.