GR M

GR M

  • NA
  • 5
  • 23k

System.IO.File not found Exception

Jan 14 2011 3:00 AM
Hi,
 During file copy, I'm giving the absolute file name. But the compiler says file not found always. Is it a problem in my system or any error in my program.
[code]

 Public Sub backupDB()
        Try

            Dim FileToCopy As String
            Dim NewCopy As String

            FileToCopy = "E:\Gyana_projects\Medicine_Stores_Management.accdb"
            NewCopy = String.Format("D:\BackUps\{0:yyyyMMdd}.mdb", Date.Today)

            FileCopy(FileToCopy, NewCopy)
     MsgBox("Backup Successful")
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
    End Sub

[/code]
Also I'm Giving the absolute path of the file by Copying it from the address bar
i.e:E:\Gyana_projects
File name is: Medicine_Stores_Management.accdb
Plz help ASAP.
Thanks in advance

Answers (2)