Code Comments
Programming Forum and web based access to our favorite programming groups.I have been asked to update an old VB 5 application with CD backup for the company's data files. The problem I am having is ... when you place a blank CD in the drive, and you select the cdrom drive with the drive listbox you get a "device unavailable" error 68. I tried the FileSystemObject's IsReady function and I get that the device is not ready. I need to be able to see that there is a blank CD in the drive to do the backup.....any suggestions?
Post Follow-up to this messageWriting CDs: http://www.vbaccelerator.com/home/V...g_CDs/index.asp -- Chris Hanscom - Microsoft MVP (VB) Veign's Resource Center http://www.veign.com/vrc_main.asp -- Read. Decide. Sign the petition to Microsoft. http://classicvb.org/petition/ "Jim Hubbard" <reply@groups.please> wrote in message news:%232X%23iu0SFHA.3980@TK2MSFTNGP12.phx.gbl... > I have been asked to update an old VB 5 application with CD backup for the > company's data files. The problem I am having is ... when you place a blank > CD in the drive, and you select the cdrom drive with the drive listbox you > get a "device unavailable" error 68. > I tried the FileSystemObject's IsReady function and I get that the device is > not ready. > > I need to be able to see that there is a blank CD in the drive to do the > backup.....any suggestions? > >
Post Follow-up to this messageThanks for the great links! Unfortunately, the client still has customers on 98 and wants to support them also - so the IMAPI wrapper for XP will not work for them. "Veign" <NOSPAMinveign@veign.com> wrote in message news:uCOtu50SFHA.2768@tk2msftngp13.phx.gbl... > Writing CDs: > http://www.vbaccelerator.com/home/V...g_CDs/index.asp > > -- > Chris Hanscom - Microsoft MVP (VB) > Veign's Resource Center > http://www.veign.com/vrc_main.asp > -- > Read. Decide. Sign the petition to Microsoft. > http://classicvb.org/petition/ > > > "Jim Hubbard" <reply@groups.please> wrote in message > news:%232X%23iu0SFHA.3980@TK2MSFTNGP12.phx.gbl... > blank > is > >
Post Follow-up to this messageI can't remember if Win98 has a feature where it identifies a CD type. Does Windows Explorer recognize it as a blank CD? -- Chris Hanscom - Microsoft MVP (VB) Veign's Resource Center http://www.veign.com/vrc_main.asp -- Read. Decide. Sign the petition to Microsoft. http://classicvb.org/petition/ "Jim Hubbard" <reply@groups.please> wrote in message news:O6UP0W1SFHA.3464@tk2msftngp13.phx.gbl... > Thanks for the great links! > > Unfortunately, the client still has customers on 98 and wants to support > them also - so the IMAPI wrapper for XP will not work for them. > > > "Veign" <NOSPAMinveign@veign.com> wrote in message > news:uCOtu50SFHA.2768@tk2msftngp13.phx.gbl... http://www.vbaccelerator.com/home/V...g_CDs/index.asp device the > >
Post Follow-up to this messageI only mention Win98 because it does not have the IMAPI functions to be wrapped. I am currently having these issues on an XP Pro SP2 system running VB5 SP3. Is there a later SP that I should be running? We will continue trying to figure out the 98 error today....but, tomorrow, we will move forward with CD backup support for Win2000/XP and up users only. The company estimates that 75% of their customer base in on XP, so no need wasting too much time on an unsupported OS. "Veign" <NOSPAMinveign@veign.com> wrote in message news:unL6Oh1SFHA.3184@TK2MSFTNGP09.phx.gbl... >I can't remember if Win98 has a feature where it identifies a CD type. Does > Windows Explorer recognize it as a blank CD? > > > > -- > Chris Hanscom - Microsoft MVP (VB) > Veign's Resource Center > http://www.veign.com/vrc_main.asp > -- > Read. Decide. Sign the petition to Microsoft. > http://classicvb.org/petition/ > > > "Jim Hubbard" <reply@groups.please> wrote in message > news:O6UP0W1SFHA.3464@tk2msftngp13.phx.gbl... > http://www.vbaccelerator.com/home/V...g_CDs/index.asp > device > the > >
Post Follow-up to this messageAnd, yes.....the OS recognizes the CD ROM with no problems. Just to try every angle, I am going to power down and install a new Sony CD-R/RW. (May as well cover all the bases, right?) "Jim Hubbard" <reply@groups.please> wrote in message news:ePednVY0QM_VefLfRVn-3A@giganews.com... >I only mention Win98 because it does not have the IMAPI functions to be >wrapped. > > I am currently having these issues on an XP Pro SP2 system running VB5 > SP3. Is there a later SP that I should be running? > > We will continue trying to figure out the 98 error today....but, tomorrow, > we will move forward with CD backup support for Win2000/XP and up users > only. The company estimates that 75% of their customer base in on XP, so > no need wasting too much time on an unsupported OS. > > > > "Veign" <NOSPAMinveign@veign.com> wrote in message > news:unL6Oh1SFHA.3184@TK2MSFTNGP09.phx.gbl... > >
Post Follow-up to this messageNew Sony installed. XP Pro sees it with no problems. The FileSystemObject still freaks out from within VB5 SP3. If there is a blank CD in the drive, it returns .IsReady= False , and errors out on CDROMs with blank media in them. Here's he code (just a form with a command button and the Scripting Runtime added to the references for the project). '<Cut here>----------------------------------------------- Function IsDriveReady(driveletter As String) As Boolean Dim fs As FileSystemObject Set fs = New FileSystemObject IsFloppyReadyB = fs.GetDrive(driveletter).IsReady Set fs = Nothing End Function Function FreeSpace(driveletter As String) As String Dim fs As FileSystemObject Set fs = New FileSystemObject FreeSpace = Str(fs.GetDrive(driveletter).FreeSpace) Set fs = Nothing End Function Function TotalSpace(driveletter As String) As String Dim fs As FileSystemObject Set fs = New FileSystemObject TotalSpace = Str(fs.GetDrive(driveletter).FreeSpace) Set fs = Nothing End Function Private Sub Command1_Click() Dim dletter As String dletter = "C:" TestDrive (dletter) dletter = "D:" TestDrive (dletter) End Sub Private Sub TestDrive(dletter As String) MsgBox IsDriveReady(dletter) MsgBox FreeSpace(dletter) MsgBox TotalSpace(dletter) End Sub '<Cut here>----------------------------------------------- "Jim Hubbard" <reply@groups.please> wrote in message news:J4OdnQoUy9S0ePLfRVn-rA@giganews.com... > And, yes.....the OS recognizes the CD ROM with no problems. > > Just to try every angle, I am going to power down and install a new Sony > CD-R/RW. (May as well cover all the bases, right?) > > > "Jim Hubbard" <reply@groups.please> wrote in message > news:ePednVY0QM_VefLfRVn-3A@giganews.com... > >
Post Follow-up to this messageFound a way to do it! It's a hack, but it works. Had to change some PSC code around a little to ake it work, but it is at lest detecting "no cd", "blank cd" in XP Pro. Next I'm installing a VMWare Virtual Macine wih Win98 to test it there. If you want the code, remove the caps and spaces from [jPEDFSim__h DONT ubbard@ MSN hotmailS.com] and send me an email. Thanks for your help. "Jim Hubbard" <reply@groups.please> wrote in message news:C4qdnRfiSMywc_LfRVn-sA@giganews.com... > New Sony installed. XP Pro sees it with no problems. The > FileSystemObject still freaks out from within VB5 SP3. If there is a > blank CD in the drive, it returns .IsReady= False , and errors out on > CDROMs with blank media in them. > > Here's he code (just a form with a command button and the Scripting > Runtime added to the references for the project). > > '<Cut here>----------------------------------------------- > Function IsDriveReady(driveletter As String) As Boolean > > Dim fs As FileSystemObject > Set fs = New FileSystemObject > > IsFloppyReadyB = fs.GetDrive(driveletter).IsReady > > Set fs = Nothing > > End Function > > Function FreeSpace(driveletter As String) As String > > Dim fs As FileSystemObject > Set fs = New FileSystemObject > > FreeSpace = Str(fs.GetDrive(driveletter).FreeSpace) > > Set fs = Nothing > > End Function > > Function TotalSpace(driveletter As String) As String > > Dim fs As FileSystemObject > Set fs = New FileSystemObject > > TotalSpace = Str(fs.GetDrive(driveletter).FreeSpace) > > Set fs = Nothing > > End Function > > Private Sub Command1_Click() > > Dim dletter As String > > dletter = "C:" > TestDrive (dletter) > > dletter = "D:" > TestDrive (dletter) > > End Sub > > Private Sub TestDrive(dletter As String) > > MsgBox IsDriveReady(dletter) > MsgBox FreeSpace(dletter) > MsgBox TotalSpace(dletter) > > End Sub > '<Cut here>----------------------------------------------- > > > > > "Jim Hubbard" <reply@groups.please> wrote in message > news:J4OdnQoUy9S0ePLfRVn-rA@giganews.com... > >
Post Follow-up to this messageWOW! What a spelling nightmare! "Jim Hubbard" <reply@groups.please> wrote in message news:%23Uyx4n2SFHA.228@TK2MSFTNGP12.phx.gbl... > Found a way to do it! It's a hack, but it works. > > Had to change some PSC code around a little to ake it work, but it is at > lest detecting "no cd", "blank cd" in XP Pro. > > Next I'm installing a VMWare Virtual Macine wih Win98 to test it there. > > If you want the code, remove the caps and spaces from [jPEDFSim__h DONT > ubbard@ MSN hotmailS.com] and send me an email. > > Thanks for your help. > > "Jim Hubbard" <reply@groups.please> wrote in message > news:C4qdnRfiSMywc_LfRVn-sA@giganews.com... > >
Post Follow-up to this messageI have been looking through the MSDN to find a way to determine a blank media in a CD drive but could not find anything. Good you got it working... -- Chris Hanscom - Microsoft MVP (VB) Veign's Resource Center http://www.veign.com/vrc_main.asp -- Read. Decide. Sign the petition to Microsoft. http://classicvb.org/petition/ "Jim Hubbard" <reply@groups.please> wrote in message news:e4ednaRiXZ3ZZ_LfRVn-pA@giganews.com... > WOW! What a spelling nightmare! > > > > "Jim Hubbard" <reply@groups.please> wrote in message > news:%23Uyx4n2SFHA.228@TK2MSFTNGP12.phx.gbl... Sony be VB5 type. http://www.vbaccelerator.com/home/V...g_CDs/index.asp backup the to > >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.