Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Problem with VB and non-working drive

Posted on 2001-06-18
Medium Priority
Last Modified: 2010-05-02
1. I have a system with a non-working Zip 100 drive attached.
2. I currently CANNOT remove this drive from the system.
3. My VBApp must check Volume label of every single drive attached to the system.

The Zip Drive is definitely not working as it chokes as I insert a media into it, and the media cannot be read. At the same time, the system recognizes the drive, and this drive appears in the list of all drives attached to the system. My VB app is looping through all drives in the system while checking for a particular volume label. As the app reaches the Drive that is not working, the entire system hangs without timeout or generating any error messages. The only thing I can do is reboot. Is there any way to (programmatically) avoid this situation.
Question by:tbbrhun
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +3

Expert Comment

ID: 6203550
Could you explain more how you are doing it in code. Maybe show the code that is actually checking the for the label. Or another suggestion would be to disconnect the Zip drive from your system.

Expert Comment

ID: 6203573
Hmm, I'd put my code to check for drives into an ActiveX dll.

The first advantage is that the EXE will not hang your complete application.

Second one is that you can start it up multiple times (create instances of the exe).  You can "watch" them and if one does not react within let say one minute, you can kill it from your main app (that's on a different thread, so you can do that).

Starting multiple instances will be faster too, but not that easy to program though ....

Expert Comment

ID: 6203575
hmm, not an activex dll, but an activex exe of course ...
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 6203902
This application works with removable media, and if it's not a zip drive, it could be any other drive on any other machine that cannot read the media, so now that I found this problem I have to have a way to detect it beforehand rather than disconnection the drive that is very often beyond my reach. I'm using the Drives collection off the Filesystem object where each Drive object in the Drives collection has a VolumeName property which I check. And since the information of VolumeName is actually stored on the media rather than the drive itself, and media cannot be read, this problem occurs.

About ActiveX EXE... I really have to think of the structural impact, but it might be interesting. I'll try it if not other solution comes up.



Expert Comment

ID: 6203921
What I meant was there probably isn't anything wrong with your code.  Since you've established that the drive itself is bad. Its drivers might be hanging up the system while waiting for a response from the drive that your program is requesting.

Author Comment

ID: 6203972
Well, that's propably true becuase same code works well on other machines with identical configuration. I wonder what I can do about it. I just left my bad machine for an hour, and there's not response -it's still hanging...

Expert Comment

ID: 6204087
try to use IsReady from Mircosoft scripting lib

Expert Comment

ID: 6204089
found a sample :  
Dim ljFileSys As Scripting.FileSystemObject
  Dim ljDrive As Scripting.Drive
  Dim ljNode As MSComctlLib.Node
  Set ljFileSys = New FileSystemObject
  TreeView1.Nodes.Add , , "root", "My Computer"
  For Each ljDrive In ljFileSys.Drives
    If ljDrive.IsReady = True Then
      Set ljNode = TreeView1.Nodes.Add("root", tvwChild, ljDrive.DriveLetter, ljDrive.DriveLetter, "drive")
      Set ljNode = TreeView1.Nodes.Add("root", tvwChild, ljDrive.DriveLetter, ljDrive.DriveLetter, "drive")
      ljNode.ForeColor = vbRed
    End If
    ljNode.Tag = "drive"

Author Comment

ID: 6206955
I checked my code, and I do check the IsReady property before attempting to do anything else with the drive. I ran multiple tests, and this is exactly the statement where where the system freezes, alas...

Expert Comment

ID: 6207396

Are you able to disconnect the Zip Drive?  If you can I would recommend it so you can finish testing your program.
Otherwise your computer is going to hang up everytime. OOOH
quick thought.  For testing purposes you could (in code) tell it that when it reaches the drive letter of you zip drive to skip over it and go to the next drive letter. That way it doesn't lock up.

Author Comment

ID: 6207438
this particular development machine is not a problem, I can disconnect the Zip drive at any time, but with this program being a prototype of a commercial software that will use removable media drives, I want to avoid this problem to happen on other machines where removeing and replacing a drive is beyond my reach, besides I can never know the drive letter or drive type used. Now I unserstand it's a tough one.
LVL 49

Expert Comment

ID: 7136265
Hi tbbrhun,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Refund points and save as a 0-pt PAQ.

EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
DanRollins -- EE database cleanup volunteer

Accepted Solution

Computer101 earned 0 total points
ID: 7173365
Question placed in PAQ

E-E Moderator

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

715 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