Import files name to table - name,extension,creation date

Magnus1982

Registered User.
Local time
, 22:53
Joined
Apr 29, 2017
Messages
41
Hello,


I am lookinh way to import filename from directory in to access tabel. But I want to have imported to 3 sapereate column in tabel file name , extension, creation date.


I found many codes which doing that but all copying file name to one column .


Please help.


Thank you
 
Another way is to use FileSystemObject, which has methods to return what you want without having to parse strings.
 
Here are some FSO functions that process filenames. The first two, GetBaseName and GetExtensionName will both separate the filename from the extension.
Code:
Sub Test928346912487()
    Const TMP = "C:\Folder\File.txt"
    
    With CreateObject("Scripting.FileSystemObject")
        Debug.Print .GetBaseName(TMP)
        Debug.Print .GetExtensionName(TMP)
        Debug.Print .GetFileName(TMP)
        Debug.Print .GetDriveName(TMP)
        Debug.Print .GetParentFolderName(TMP)
    End With
End Sub
Mark
 

Users who are viewing this thread

Back
Top Bottom