Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with VB and non-working drive

Posted on 2001-06-18
13
Medium Priority
?
153 Views
Last Modified: 2010-05-02
Given:
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.

Details:
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.
0
Comment
Question by:tbbrhun
  • 4
  • 3
  • 2
  • +3
13 Comments
 

Expert Comment

by:nongravity
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.
0
 
LVL 4

Expert Comment

by:vindevogel
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 ....
0
 
LVL 4

Expert Comment

by:vindevogel
ID: 6203575
hmm, not an activex dll, but an activex exe of course ...
0
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.

 

Author Comment

by:tbbrhun
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.

Thanks!!!

0
 

Expert Comment

by:nongravity
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.
0
 

Author Comment

by:tbbrhun
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...
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6204087
try to use IsReady from Mircosoft scripting lib
0
 
LVL 5

Expert Comment

by:rkot2000
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")
    Else
      Set ljNode = TreeView1.Nodes.Add("root", tvwChild, ljDrive.DriveLetter, ljDrive.DriveLetter, "drive")
      ljNode.ForeColor = vbRed
    End If
    ljNode.Tag = "drive"
   
    ljNode.EnsureVisible
  Next
0
 

Author Comment

by:tbbrhun
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...
0
 

Expert Comment

by:nongravity
ID: 6207396
tbbrhun,

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.
0
 

Author Comment

by:tbbrhun
ID: 6207438
nongravity:
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.
0
 
LVL 49

Expert Comment

by:DanRollins
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
0
 
LVL 1

Accepted Solution

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

Computer101
E-E Moderator
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

824 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