Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to check if a drive is availeble

Posted on 2003-02-19
4
Medium Priority
?
154 Views
Last Modified: 2010-04-07
my program uses the disk drive. How can I check that there is an disk in the drive so that I don't run on an error.
0
Comment
Question by:jpwiedenhoff
  • 3
4 Comments
 
LVL 8

Expert Comment

by:List244
ID: 7984912
Just add an error check Something like that

on error goto ErrorS

Private Sub NAME()
YOURCODE
HERE
exit sub
ErrorS:
Msgbox "No disk is in the drive"
End Sub
0
 
LVL 2

Expert Comment

by:JoaTex
ID: 7985034
Hi
Private Sub Form_Click()
   On Error GoTo ErrorHandler
   ChDir "a:\"
   Exit Sub
ErrorHandler:
   MsgBox "There's no Disk in Drive"
End Sub
0
 
LVL 8

Expert Comment

by:List244
ID: 7990279
yeah little mistake there 'on error' goes in the sub, sorry about that
0
 
LVL 8

Accepted Solution

by:
List244 earned 80 total points
ID: 7990421
'Should like like this, sorry.

Private Sub NAME()
on error goto ErrorS
'YOURCODE
'HERE
exit sub
ErrorS:
Msgbox "No disk is in drive"
End Sub
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question