Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

Deleting unfound external files

Discussion in 'Information Technology' started by John, Jul 28, 2006.

  1. John

    John
    Expand Collapse
    Guest

    Hi

    How can I do this programmatically;

    1. Read the first file in a folder.

    2. Search for its path+name in a field in a table.

    3. If not found, delete the file in the folder.

    4. Repeat from step1 until all files in the folder checked.

    Thanks

    Regards
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Is Mahesh Bhatt considering deleting Meera's controversial kissing ... Breaking News Mar 4, 2005

  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Something like the following untested air-code:

    Dim strFolder As String
    Dim strFile As String

    strFolder = "C:\Some Folder\Some Subfolder\"
    strFile = Dir$(strFolder & "*.*")
    Do While Len(strFile) > 0
    If IsNull(DLookup("[SomeField]", "[SomeTable]", _
    "[PathAndFile] = '" & strFolder & strFile & "'") Then
    Kill strFolder & strFile
    End If
    strFile = Dir()
    Loop

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "John" <John@nospam.infovis.co.uk> wrote in message
    news:%23wKEaKwiGHA.1552@TK2MSFTNGP03.phx.gbl...
    > Hi
    >
    > How can I do this programmatically;
    >
    > 1. Read the first file in a folder.
    >
    > 2. Search for its path+name in a field in a table.
    >
    > 3. If not found, delete the file in the folder.
    >
    > 4. Repeat from step1 until all files in the folder checked.
    >
    > Thanks
    >
    > Regards
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page