Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I report the size of external files and directories in Access?

Status
Not open for further replies.

motaman

Programmer
Mar 17, 2000
6
CA
I need to create a report within Access on the size of files and directories at the windows98/windowsNT level. I know you must be able to, but I don't have a clue how to do it. How do I read system level information external to the DB container into a table so I can report disk usage statistics?
 
Use the GetFile method of the FileSystemObject to return a file object. A file object has a size property which will tell you its size. If you need to list through files and folders, the FileSystemOobject has a drives collection. Each drive in it has a RootFolder property which has a files collection for each file in the folder and a subfolders collection which contains folder objects which in turn contains a files collection and a subfolders collection and so on. To create a FileSystemObject create a reference to the Scripting library or use the following syntax
Code:
dim Obj as object

    set Obj = CreateObject("Scripting.FileSystemObject")
Hope this helps.B-) Durkin
alandurkin@bigpond.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top