Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Exclamation Unanswered: Searching 4 Files

    I wrote the next code to search for all mdb files in the C:\ drive

    PHP Code:
      Dim sFound As String
      Dim cPatt 
    As StringcPath As String
      Dim datei 
    As VariantAs Integer
      
      cPatt 
    "*.mdb"
      
    cPath "c:\"
      With Application.fileSearch
        .NewSearch
        .lookin = cPath
        .SearchSubFolders = True
        .filename = cPatt
        If .Execute > 0 Then
          For Each datei In .foundfiles
               sFound = sFound & datei & vbNewLine
               sFound = sFound & FileSystem.FileLen(datei) & " 
    KB"
               sFound = sFound & FileSystem.FileDateTime(datei)
               MsgBox (sFound)
               i = i + 1
          Next
        End If
       End With
       MsgBox ("
    Total found " & cPatt & " in " & cPath & " " & i) 
    The problem is, it shows some files which are not in the C: sometimes on D: or R: (I have D:, but I don't have a drive called R:)

    Does any one know the reason?
    Thanks

  2. #2
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    I tried the code on my machine and it only returned files from the c drive.

    I can't understand why you are getting the strange results
    Access XP & WinXP Pro

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Thank you for your trial, Perhaps someone get the strange results

Posting Permissions

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