Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy file if opened (Access 2000)

    I have a function that sends a database into another computer but when the computer is shut down, i get the error of a bad file.My function is the following :
    If Dir(Emi) <> "" Then
    Kill Emi
    End If
    StrDest = Emi
    FileCopy StrSource, StrDest

    I have to put a condition to copy the file only when the computer is opened, but otherwise not to stop the function.How can i do that?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy file if opened (Access 2000)

    It's not clear from your code where the other computer comes in. Is this a network computer?

  3. #3
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy file if opened (Access 2000)

    Thank you. Yes, this is a network computer

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy file if opened (Access 2000)

    OK, but the code fragment you posted does not give any indication of a network path.

  5. #5
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy file if opened (Access 2000)

    Thank you. The path is :
    Public Const Emi As String = "EmiBEArchiveGardensGardens.mdb"

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Copy file if opened (Access 2000)

    There was another question recently about testing whether a server is online (<post:=571,600>post 571,600</post:>) and we didn't find a satisfactory solution. So you'd better check that the server is available before running the code.

Posting Permissions

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