Question : Acces to Path Denied error in VB.net

Hi ,

Im getting this error

System.UnauthorizedAccessException: Access to the path 'C:\Price\2006\PRO.DBF' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
   at System.IO.File.Copy(String sourceFileName, String destFileName)

The problem is that the error comes in AFTER many hundreds sucessfull reads of that same file in the same process its a loop where by I copy a file to its temp name PRO.DBF work with it and then overwrite the original with the copy. The process works sucessfully on many machines without a hickup only one machine is giving me problems its XP profesional version machine , it just decieds that its not going to do what it sucessfully dome many times and crashes, I placed traces to make sure that all processing paths lead to file closes and disposition of objects tied to it and they do ..........

any ideas ?

Answer : Acces to Path Denied error in VB.net

I have stumbeled across the solution, I dont know why but it was a problem deleting the file, when I changed the code to copy only with over write set as true it didnt miss a beat at all. Same process same code except the delete part.

Thank you for taking the time to investigate and try to help
Random Solutions  
 
programming4us programming4us