Solved

Problem with VB and non-working drive

Posted on 2001-06-18
13
144 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now