FileCopy in vb6.0
-
Hello friends! Please help me out of this stuff. I have the following code to copy files from one folder to another in vb6.0. FileCopy App.Path & "C:\mywork\dbase.mdb", App.Path & "C:\newfiles". From the code, mywork is the folder that contains the file I want to copy, and newfiles is the destination folder. But when I click on the copy button, it shows runtime error, Path not found. Please any help will be appreciated.
-
Hello friends! Please help me out of this stuff. I have the following code to copy files from one folder to another in vb6.0. FileCopy App.Path & "C:\mywork\dbase.mdb", App.Path & "C:\newfiles". From the code, mywork is the folder that contains the file I want to copy, and newfiles is the destination folder. But when I click on the copy button, it shows runtime error, Path not found. Please any help will be appreciated.
Re-read what you just posted. You're prepending App.Path to the hardcoded path of "C:\mywork\dbase.mdb" and "C:\newfiles". What's the value of App.Path?? What would the complete paths look like if you prepended that value to both of the paths you specified?? Does those results look like valid file/folder paths to you??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Re-read what you just posted. You're prepending App.Path to the hardcoded path of "C:\mywork\dbase.mdb" and "C:\newfiles". What's the value of App.Path?? What would the complete paths look like if you prepended that value to both of the paths you specified?? Does those results look like valid file/folder paths to you??
A guide to posting questions on CodeProject[^]
Dave KreskowiakHello Dave, thanks for your reply. Please can you help me out to solve it, because I really need it.
-
Hello Dave, thanks for your reply. Please can you help me out to solve it, because I really need it.
I've told you exactly what to look at so you can solve it yourself. This is VERY easy to solve, if you have any debugging knowledge at all. Click on the FileCopy line, set a breakpoint on it (under the Debug menu) and run your code. When it gets to this line, the code will stop. You can then use the Visual Studio debugger to look at the values of variables. I can't tell you exactly what the line should read because only YOU know exactly what you want this code to do.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Hello friends! Please help me out of this stuff. I have the following code to copy files from one folder to another in vb6.0. FileCopy App.Path & "C:\mywork\dbase.mdb", App.Path & "C:\newfiles". From the code, mywork is the folder that contains the file I want to copy, and newfiles is the destination folder. But when I click on the copy button, it shows runtime error, Path not found. Please any help will be appreciated.
From your post it would seem that leaving off the App.Path and just using the actual file locations would work for you. i.e, FileCopy c:\mywork\dbase.mdb, c:\newfiles. That is, if the mywork directory is under C:\ and it is truly not under your apps working directory. Typically the debugger will let you know what is failing so you should look at that as you program when things do not work. ;) You may have to show more actual code here to have someone help you.
vbmike