"Paolo" <(E-Mail Removed)> wrote in message
news:73220BBD-F8E4-48C5-94AB-(E-Mail Removed)...
> Good point Stefan, I didn't think about timing...
> In some cases that could create some problems that using the API function
> could avoid. Thanks for the feedback
>
> "Stefan Hoffmann" wrote:
>
>> hi Paolo,
>>
>> On 18.03.2010 11:45, Paolo wrote:
>> > this is one way
>> > this is another way to do the same
>> Not really, both solutions have the same problem: Timing.
>>
>> Right after checking for the non-existence of the file any other process
>> may create this file. Then your FileCopy will still fail.
On the other hand, the FileSystemObject.CopyFile method does have an
<overwrite> argument that can be specified as False to prevent overwriting
an existing file. If you try, an error will be raised, that one would
presumably want to trap in the code.
--
Dirk Goldgar, MS Access MVP
Access tips:
www.datagnostics.com/tips.html
(please reply to the newsgroup)