
Finding the size of a folder
If you wish to find out the size of a folder from Access, it seems that the easiest way of doing this is to use the FileSystemObject.
In order to use this object, you will first need to set a reference to the Microsoft Scripting Runtime library, 'scrrun.dll'.
You can then use an Access function such as:
Function fFolderSpace(strFolderName As String) As Double
On Error GoTo E_Handle
Dim fso As New FileSystemObject
Dim folder As Folder
If Right(strFolderName, 1) <> "\" Then strFolderName = strFolderName & "\"
Set folder = fso.GetFolder(strFolderName)
fFolderSpace = folder.Size
fExit:
Exit Function
E_Handle:
Select Case Err.Number
Case 76
Case Else
MsgBox Err.Description, vbOKOnly + vbCritical, "Error: " & Err.Number
End Select
fFolderSpace = -1
Resume fExit
End Function
|
Top
HOME |
NEW |
TABLES |
QUERIES |
FORMS |
REPORTS |
GENERAL |
API |
DOWNLOADS |
TUTORIAL |
RESOURCES
E-MAIL
Copyright & Disclaimer
|