Results 1 to 2 of 2

Thread: error trap

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Manchester
    Posts
    446

    Question

    Can anyone tell me how to error-trap this so i overwrite files even if they are there?/

    Many thanks

    FilesCopied.CopyFolder "d:\" + "All Products" + "\" + "java Files", Path2 + "\" + "attuk" + "\" + Products.Text + "\" + "accprice", True

  2. #2
    Hyperactive Member scuzymoto's Avatar
    Join Date
    Aug 1999
    Location
    Washington State
    Posts
    316
    Just an idea ...

    Put two filelist controls on your form. Set the visible properties of both to false. Set the path of one to the destination directory for the files you are copying and the other to the source. Then compare the files in each to delete any files that might block your operation before replacing them.

    For nElement2 = 0 to (Filelist2.Count - 1)
    For nElement1 = 0 to (FileList1.Count - 1)
    If Filelist1.list(nElement1) = FileList2.List(nElement2) then
    Kill Filelist1.list(nElement1) 'delete it first
    End If
    Next
    FileCopy(FileList2.list(nElement2),FileList1.List(nElement1))
    Next

    [Edited by scuzymoto on 05-03-2000 at 06:27 PM]
    SCUZ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width