Discussion Locked

File access date

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am building an MS Access application (with Visual Basic coding) which populates a table with a directory's contents. It lists all the folders and sub-folders (for a directory on the network) and the files in each. I have managed to get the modified date with the FileDateTime statement.

I've also looked on the MS knowledge base for obtaining the date created / modified / accessed. The solution they proposed involves opening a file handler and obtaining the dates through functions that use 'Lib "kernel32"'. It works well, but fails to open a file handle roughly 50% of the time.

Does anybody have a better solution to obtaining the dates mentioned above? I am looking for a freeware product or using VB code in MS Access.

Thank you.

3 replies

by jackofalltech

Before I suggest the answer, I must tell you that only NTFS supports tracking the file access date/time. If you are using FAT32, then you might as well stop reading now.

Look up the API call "FindfirstFile". It uses a structure WIN32_FIND_DATA that contains the fiel access time (with the caveat above).

Ralph

This discussion is closed to new replies.