system.io.file not found exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GR M
    New Member
    • Dec 2010
    • 19

    system.io.file not found exception

    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
    Also I'm Giving the absolute path of the file by Copying it from the address bar
    i.e:E:\Gyana_pr ojects
    File name is: Medicine_Stores _Management.acc db
    Plz help ASAP.
    Thanks in advance
  • prasad599
    New Member
    • Feb 2009
    • 24

    #2
    Have you tried giving same file extension, because your src file is .accdb and destination is .mdb

    Comment

    • GR M
      New Member
      • Dec 2010
      • 19

      #3
      Yes, I have tried those. The only soln I'v Got, that the code is almost perfect.The problem might be in the system. The Access That I'v used is of unregistered version. While openining, It always asks to register. This might be the cause of all problem. I'v modified the code to copy other files, such as .vb or .txt. It works fine. Thanks for your prompt reply MR. Prasad599. Plz reply me on these thoughts.

      Comment

      • prasad599
        New Member
        • Feb 2009
        • 24

        #4
        Is your OS version higher than win XP ?

        Comment

        • GR M
          New Member
          • Dec 2010
          • 19

          #5
          No. I'm running on Win xp Sp3.

          Comment

          • GR M
            New Member
            • Dec 2010
            • 19

            #6
            Hello Prasd599, I'v finally made it. Actually the code was perfect. The problem was with the unregistered version of MS Access. I'v fixed it and all is well. Thanks a lot Showing interest in my problem. Tk Kr.

            Comment

            Working...