PRB: Device Unavailable Msg When Change Path & Drive Door Open

Last reviewed: June 21, 1995
Article ID: Q80645
The information in this article applies to:

- Microsoft Visual Basic programming system for Windows,

  versions 1.0, 2.0, and 3.0

SYMPTOMS

Changing the Path property of a directory list box or a file list box to a floppy drive that has an open drive door or no disk present results in the following error:

   Error: 68 Device unavailable

instead of this more expected error:

   Error: 71 Disk not ready

This occurs whether you run the program in the VB.EXE environment or as an .EXE file.

STATUS

This behavior is by design.

MORE INFORMATION

The following definitions for errors 68 and 71 can be found in the Visual Basic online Help:

Error 68 Device Unavailable

The device you are trying to access is not online or does not exist.

Error 71 Disk Not Ready

There is no disk in the drive specified, or the drive door is open. Insert a disk in the drive, close the door, and retry the operation.

Attempting to open a file on a drive that has an open door or missing disk generates Error 71, "Disk Not Ready."

Steps to Reproduce Behavior

  1. Start Visual basic or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. Form1 is created by default.

  2. Add a drive list box (drive1) and file list box (file1) to Form1.

  3. Add the following code to the Drive1_Change event procedure:

       Sub Drive1_Change ()
          On Error GoTo Trap
          File1.path = drive1.drive
          Exit Sub
       Trap:
          MsgBox "Error:"+Str$(Err)+" "+Error$(Err)
          Resume Next
       End Sub
    
    

  4. From the Run menu, choose Start (ALT, R, S) to run the program.

Changing the drive in the drive list box to a drive that is open or that contains no disk causes a message box to display:

   Error: 68 Device unavailable


Additional reference words: 1.00 2.00 3.00
KBCategory: kbenv kbprg kbprb
KBSubcategory: EnvtRun


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