Friends, I met with a small problem please help me
I developed a small programme. When I exit from it I want to make a backup in another drive
I coded like this

  FileCopy "I:\My Documents\New Folder\Pebble.mdb", "D:\Pebble\Pebble.mdb"

Here the "Pebble.mdb" is my database in Drive "I". I want to copy it to Drive "D" on exiting. The code is under the click event of command button Exit.On running the programme I am getting the error message "Permission Denied" How can I solve?
And if I want to take a back up in my pendrive what coding should be?In my computer the pendrive is in K: While in some it is in H: How can I code the target drive common to all computers?
Please help me..

Dim SourceFile, DestinationFile As String
SourceFile = "SRCFILE" ' Define source file name.
DestinationFile = "DESTFILE" ' Define target file name.
FileCopy(SourceFile, DestinationFile) ' Copy source to target

I tried the above code as follows

Dim SourceFile, DestinationFile As String
SourceFile = "C:\My Documents\New Folder\Pebble.mdb" 
DestinationFile = "D:\Pebble\Pebble.mdb" 
FileCopy SourceFile, DestinationFile 

On working, the following error message is shown :Permission denied.

Edited 2 Years Ago by mavtcr

I think the folder requires administrator permission to copy the files . Try with the folder in D drive . It might works !!!

Sorry.. What should I do.. I have little knowledge in this field...

I think the folder requires administrator permission to copy the files . Try with the folder in D drive

i think it can be solved by starting application with administrator rights. you can do that by running it as administrator.It can be simply find by right clciking on the application icon.

Sorry I am not getting on right clicking. On right clicking options like the following are listed.. Open,make,run ,MediaInfo,Open with,Send to,Copy,Delete,Rename,Cut etc. .. Administrator does not come to the picture.What can I do?

This article has been dead for over six months. Start a new discussion instead.