DATE of creation of file...

User avatar
sal21
PlatinumLounger
Posts: 4362
Joined: 26 Apr 2010, 17:36

DATE of creation of file...

Post by sal21 »

Based the code above is possible to use tha same FSO object to know the Created Date of file, or i need set a new FSO object?

Code: Select all

Sub ListFolder(sFolderPath As String)

    Dim FS As New FileSystemObject
    Dim FSfolder As Folder
    Dim File As File
    Dim TEST As String
    
    Set FSfolder = FS.GetFolder(sFolderPath)
    
    For Each File In FSfolder.Files
    TEST = Right$(File, 19)
    SQL = "SELECT INDICE FROM DATE_INQ WHERE INDICE='" & TEST & "'"
    Set RS1 = CONN.Execute(SQL)
    
    If RS1.EOF Then
        Call TEST_CLONI(File)
        End If
        
    Next File
    
    Set FSfolder = Nothing
    
End Sub

User avatar
HansV
Administrator
Posts: 78545
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: DATE of creation of file...

Post by HansV »

You can use File.DateCreated
Best wishes,
Hans

User avatar
John Gray
PlatinumLounger
Posts: 5411
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: DATE of creation of file...

Post by John Gray »

Beware that the date created information is NOT reliable. The only date field which is reliable is the date modified.
John Gray

"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...