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

Gilbert Peeters 1 Reputation point
2021-11-26T09:18:20.317+00:00

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"
            Loop
        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.
TIA

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.
822 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Karl Donaubauer 1,646 Reputation points MVP
    2021-11-29T09:50:15.943+00:00

    Hi,

    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.

    Servus
    Karl


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

    0 comments No comments

  2. ABU 1 Reputation point
    2022-09-09T22:28:56.453+00:00

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

    /Abu

    0 comments No comments