About using MS-Access to retrieve image dates from the image Exif data

Gilbert Peeters 1 Reputation point

Currently I'm using the following code :

I "borrowed" this code from : @danishani
(Thank you)

Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim objFSO As Object
Dim objFolder As Object
Dim objFoto As Object

Dim strOudeNaam, strNieuweNaam As String

Set objFSO = CreateObject("Shell.Application")
Set objFolder = objFSO.Namespace(strFolderOpladen)

 For Each objFoto In objFolder.Items
    strOudeNaam = strFolderOpladen & "\" & objFoto.Name

    strDatum = objFoto.ModifyDate

    'but : strDatum = objFoto.DateCreated   <========= NOT OK

    strJaar = Mid(strDatum, 7, 4)
    strMaand = Mid(strDatum, 4, 2)
    strDag = Left(strDatum, 2)
    strUur = Mid(strDatum, 12, 2)
    strMin = Mid(strDatum, 15, 2)
    strSec = Mid(strDatum, 18, 2)

    strNieuweNaam = strFolderOpladen & "\F" & strJaar & strMaand & strDag & "-" & strUur & strMin & strSec & ".jpg"

    If Len(Dir(strNieuweNaam)) > 0 Then
        Do Until Len(Dir(strNieuweNaam)) = 0
            pubInteger = Val(strSec) + 1
            strSec = Right("00" & Trim(Str(pubInteger)), 2)
            strNieuweNaam = strFolderOpladen & "\F" & strJaar & strMaand & strDag & "-" & strUur & strMin & strSec & ".jpg"
        End If

    Name strOudeNaam As strNieuweNaam
    Next objFoto

This works perfect.
The problem is that DateModify isn't the date that the image was created.
I need the date created.
I tried a number of names (DateCreated, DateTime, OriginalDate etc. etc.)
But so far only DateModify works.
Does anybody knows the other names I can use besides DateModify ?
I read about jhead.exe and exiftool.exe , but these are to complex for me.

Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
729 questions
No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Karl Donaubauer 1,466 Reputation points


    Crystal and Colin have recently done a video about ExIfs with Access: https://www.youtube.com/watch?v=fwQnhKWo1Ks
    Maybe you find the right property or method there.


    Access-Entwickler-Konferenz: https://www.donkarl.com/?AEK
    Access DevCon: http://AccessDevCon.com
    Access FAQ (de/it): https://www.donkarl.com

    No comments

  2. ABU 1 Reputation point

    Try the property «Date taken» having index #12 in W10


    No comments