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

ID: Q80645


The information in this article applies to:
  • Microsoft Visual Basic programming system for Windows, versions 1.0, 2.0, 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 query words: 2.00 3.00

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: August 25, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.