Results 1 to 4 of 4
  1. #1
    mbar is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2011
    Posts
    12

    Copying files to a backup folder GettAttr vbarchive

    Hi- I'm using a function to find all files/folders in a specific directory, then copy each one to a specific destination folder. I'm going to use this on a weekly basis to backup files on a computer. I would like to use the vbarchive in GetAttr/SetAttr so I only need to copy these if they have changed since last backup. I don't, however, know how to do this and google searches don't seem to help. Can anyone help me?



    Something like:

    If GetAttr(strFile) And vbArchive Then
    rs.movenext
    else
    filecopy xxxx, xxxx

    when I use GetAttr, it returns values 8192 and other large numbers. How do I identify whether vbArchive is true?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    http://office.microsoft.com/en-us/ac...001228847.aspx

    I have never done bitwise comparison. So just tested:

    Sub test()
    Debug.Print GetAttr("C:\Users\June\Cryptoquote.accdb") And vbArchive
    End Sub

    This returns 32.

    If I understand the article, if the code returns non-zero, then the file has been modified since last backup. However, I doubt that just copying the file is a 'backup' in which case the value of Archive attribute will not change. So I tested that - copied file and ran the code again - still get 32.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    mbar is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2011
    Posts
    12
    Thanks. I now need to figure out how to set an attribute to each file after I filecopy to "flag" the file so my code will know not to filecopy if it hasn't been modified since the last time. I believe that the example above will identify what files have been modified since the last time the attribute was set (if it returns "32"). I've read some google searches where the file was set to vbnormal however I think that would erase any program file attributes that are vbhidden or vbreadonly (I'm planning on copying the entire hard drive). One would almost want to set the vbarchive to true or false but I don't think its a boolean.

    Any ideas?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    If the vbArchive attribute can be programmatically set, set it to 0.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Moving ALL Files in a Folder
    By JoeM in forum Programming
    Replies: 4
    Last Post: 04-19-2013, 01:59 PM
  2. Number of files in a folder.
    By Iain in forum Reports
    Replies: 3
    Last Post: 06-17-2012, 01:53 PM
  3. Replies: 5
    Last Post: 01-30-2012, 01:14 PM
  4. Copying and Rename of Files based on fields
    By desk4tbc in forum Programming
    Replies: 2
    Last Post: 06-28-2011, 11:00 AM
  5. Copying multiple files?
    By daveofgv in forum Programming
    Replies: 3
    Last Post: 04-14-2011, 03:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums