FIX: Disk or Network Error with Data Access Objects

Last reviewed: October 30, 1997
Article ID: Q114771
3.00 WINDOWS kbprg kbbuglist

The information in this article applies to:

  • Professional Edition of Microsoft Visual Basic for Windows, version 3.0

SYMPTOMS

Error 3043 (Disk or network error) can result when you run multiple instances of one Visual Basic program or you run multiple programs, and all instances or programs perform data access on the same database.

If the program does not explicitly close all the data access objects (by using db.close, for example), then the error will occur when the second instance of the program tries to work with a data access object.

WORKAROUND

Close all data access objects (tables, dynasets, snapshots, and databases) explicitly. For example, if your program has any of the following statements

   Dim db As database
   Dim ds As dynaset
   Dim sn As snapshot
   Dim tb As table
   Set db = OpenDatabase("<some database file>")
   Set ds = db.CreateDynaset("<some query>")
   Set sn = db.CreateSnapshot("<some query>")
   Set tb = db.OpenTable("<some table name>")

execute the following close statements before the program ends:

   tb.close
   ds.close
   sn.close
   db.close

NOTE: If you place the .Close methods in the Unload or QueryUnload events, make sure you invoke these events before your program ends by using the Unload statement (for example, Unload Me). Be careful when using the End statement; it does not invoke the Unload or QueryUnload events.

STATUS

This bug was corrected in Microsoft Visual Basic version 4.0 for Windows.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start Visual Basic and open the VISDATA.MAK project located in the \VB\SAMPLES\VISDATA directory (ALT, F, O).

  2. From the File menu, choose Make EXE File to create an executable.

  3. Exit Visual Basic, and run File Manager.

  4. Change directories to the \VB\SAMPLES\VISDATA directory and double-click VISDATA.EXE to run the program. Repeat this step so that two instances of VISDATA are running.

  5. In both instances of VISDATA, open the BIBILIO.MDB database located in your Visual Basic directory \VB.

  6. Close one instance of VISDATA.EXE.

  7. Start another instance of VISDATA.EXE and try to open the BIBLIO.MDB database again. You will get Error 3043 - "Disk or Network Error."


Additional reference words: buglist3.00 fixlist3.00 3.00
KBCategory: kbprg kbbuglist
KBSubcategory: APrgDataAcc
Keywords : APrgDataAcc kbbuglist kbprg
Version : 3.00
Platform : WINDOWS
Solution Type : kbfix


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