In my application, I have a backup menu item, where when user clicks Backup, the Save dialog box appears. Saving to the hard drive works fine, but when i save to the floppy and CD-R drive i get errors.
Floppy: Method 'CopyFile' of object 'IFileSystem3' failed
CD: Run-time erro: '71': Disk not ready
here is my code for the backup:
Private Sub mnuBackup_Click()
Dim fs As Object
Dim varFileName, fsFolder, fsPath, fsFileName As String
varFileName = comDlgBackup.FileName
Set fs = CreateObject("Scripting.FileSystemObject")
fsFolder = fs.getparentfoldername(varFileName)
fsFileName = fs.getfilename(varFileName)
If fsFolder = "a:\" Or fsFolder = "e:\" Then fsPath = fsFolder + fsFileName Else fsPath = fsFolder + "\" + fsFileName
fs.copyfile "C:\Cutbank - VB6\data.mdb", fsPath
i would just like them to do an ordinary save. For the CD-R drive, i'd like the file to be copied over and Windows will alert me that there are files to be written unto disk (just like what XP does when you copy/write to disk).
thanks in advance to anyone who can help!