Microsoft KB Archive/80645

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

Article ID: 80645

Article Last Modified on 11/18/2003

-

APPLIES TO


 * Microsoft Visual Basic 1.0 Standard Edition
 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition

-



This article was previously published under Q80645



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, &quot;Disk Not Ready.&quot;

Steps to Reproduce Behavior
 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. Add a drive list box (drive1) and file list box (file1) to Form1.  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 &quot;Error:&quot;+Str$(Err)+&quot; &quot;+Error$(Err) Resume Next End Sub  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: kbprb KB80645

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.