APPEND BLANK Can Cause Database Header Contention

Last reviewed: June 27, 1995
Article ID: Q99613
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SYMPTOMS

Error 108, "File is in use by another," occurs if multiple workstations on a network perform a APPEND BLANK command simultaneously.

CAUSE

The database header is briefly locked by the APPEND command, preventing access by multiple users.

RESOLUTION

Either of the following methods can be used to solve this problem:

  1. Add a SET REPROCESS TO <number of retries> command as the first line of code in the program. For example:

          SET REPROCESS TO 30   && Or appropriate interval.
          SELECT <some database name>
          FOR i = 1 TO 1000
            APPEND BLANK
          ENDFOR
    
    

  2. Add an ON ERROR DO <error handling routine> command as the first line of code in the program. Also add the required ON ERROR routine. For example:

          ON ERROR DO ERRHANDL
          SELECT <some database name>
          FOR i = 1 TO 1000
    
            APPEND BLANK
          ENDFOR
    
          PROCEDURE ERRHANDL
          * Get the error number.
          m.errcode = ERROR()
          * Get the currently executing line of code.
          m.execline = MESSAGE(1)
          * Retry when error 108 occurs on APPEND BLANK.
          IF m.errcode = 108 .AND. UPPER(m.execline) = "APPEND BLANK"
             RETRY
          ENDIF
    
    

MORE INFORMATION

This problem can be reproduced by allowing two or more workstations to execute the following code:

   SELECT <some database name>
   FOR i = 1 TO 1000
     APPEND BLANK
   ENDFOR


Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a REPROCESS
KBCategory: kbprg
KBSubcategory: FxnetworkGeneral


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 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.