We are currently in the final throes of testing our existing application before we begin the process of migrating the company over to 32-bit Windows 7 with Office 2010.
One of the remaining applications was written in VB6, and is experiencing a problem when it gets to perform a filecopy action.
Currently, it writes data to a file called MIDNSPTEMP.$$$ and when finished, uses the FileCopy command to copy it to an existing file called MIDNSP.$$$, where it gives me a Permission denied error. The next line which deletes the MIDNSPTEMP.$$$ is never hit.
If I create a new file in the same folder manually, that works, and I can also delete a file.
Can anyone point me at why it gives me a permission denied in this situation? VB6 is not a language that I am very familiar but no-one else is available to look at this.
Thanks in advance
Martin
0
votes
2 Answers
1
votes
0
votes
Are you sure that the file is not locked by another process (or by another part of your own code)? ProcessMon ( http://technet.microsoft.com/en-us/sysinternals/bb896645 ) from SysInternals is your friend. It will record ever I/O to your file along with successes and failures.
Open Datadir + csNspTempFile For Output As #3
, whereas the code to open the file being read isOpen Datadir + csNspFile For Input As #2
. Each file is then closed usingClose #2
andClose #3
respectively. – Martin S