Obtaining Folder properties

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I'm designing some reports which require the folder size &
number of files in a folder. How would this be best done
within Access 2000 running on a W2K machine? TIA
 
you can use DIR function to count number of files and FileLen function to
get filesize of each file
 
I'm designing some reports which require the folder size &
number of files in a folder. How would this be best done
within Access 2000 running on a W2K machine? TIA

Here's a test routine to followup on Alex's suggestion.

Sub TestDirSize()
Const FOLDER = "C:\Temp\"
Dim tmp As String
Dim size As Long, count As Integer

tmp = Dir$(FOLDER & "*.*")
Do While Len(tmp) > 0
count = count + 1
size = size + FileLen(FOLDER & tmp)
tmp = Dir
Loop
MsgBox "Count: " & count & vbCrLf & _
"Size: " & size
End Sub

-- Dev
 
Works like a charm. Thanks
-----Original Message-----


Here's a test routine to followup on Alex's suggestion.

Sub TestDirSize()
Const FOLDER = "C:\Temp\"
Dim tmp As String
Dim size As Long, count As Integer

tmp = Dir$(FOLDER & "*.*")
Do While Len(tmp) > 0
count = count + 1
size = size + FileLen(FOLDER & tmp)
tmp = Dir
Loop
MsgBox "Count: " & count & vbCrLf & _
"Size: " & size
End Sub

-- Dev
.
 
Back
Top