Results 1 to 5 of 5

Thread: CD drive

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Antwerp,Belgium
    Posts
    21

    Question

    I'm writing an access application that prompts the user to insert a CD in the drive, afterwards when I try to access the drive I get errors like 'device not ready' ...
    Is there a way to determine if the drive is ready?

    thanks

  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287
    Hi nevyn,

    This is just a suggestion and I haven’t tried it myself but it may be worth a go. Try using the GetVolumeInformation API and if there is no Volume label then the drive isn’t ready. Let me know if it works. Good Luck!
    rino_2
    Visual Basic, HTML
    Please Visit my Site: Richard's VB Site

  3. #3
    Guest
    This was a good example from Mark Sreeves.

    Code:
    Function DiskInDrive() As Boolean
    On Error GoTo ErrHan
      Dir "D:\", vbDirectory
      
      DiskInDrive = True
    Exit Function
    
    ErrHan:
      DiskInDrive = False
    
    End Function
    
    If DiskInDrive() Then
      MsgBox "There is a CD in D drive."
    Else
      MsgBox "No CD detected in D drive."
    End If

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Antwerp,Belgium
    Posts
    21

    Thumbs up

    Thanks for the information, I will certainly try the suggestions and I will let you know the results

  5. #5
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Thumbs up

    Hi nevyn,

    The way that I suggested with the GetVolumeInformation API does work, I tested it myself. Although I think you would be better off using Matthew Gates's way because its much easier!
    rino_2
    Visual Basic, HTML
    Please Visit my Site: Richard's VB Site

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width