Reading IPTC metadata in JPEGs (1 Viewer)

MarkK

bit cruncher
Local time
Today, 11:39
Joined
Mar 17, 2004
Messages
8,179
On my system, late-bound variables failed. It worked when I set a reference to Shell32.dll and used strongly typed variables. This is what I'm suggesting to the OP to try next. I think he set the reference, but he's still not strongly typing his variables. We'll see...
 

sneuberg

AWF VIP
Local time
Today, 11:39
Joined
Oct 17, 2014
Messages
3,506
On my system, late-bound variables failed. It worked when I set a reference to Shell32.dll and used strongly typed variables. This is what I'm suggesting to the OP to try next. I think he set the reference, but he's still not strongly typing his variables. We'll see...

When I search for Shell32.dll on my system (Windows 7) I get more than 30 hits. Assuming the OP has lots of them too what's the chances of the right one being selected for a reference. I think we need to find out why this reference isn't showing up in the OP's references at least if it should be. Maybe Access needs to be repaired or reinstalled.

I've attached a test database if anyone is interested.
 

Attachments

  • MetaDataUsingShell.accdb
    428 KB · Views: 144

jray9242

Registered User.
Local time
Today, 11:39
Joined
Mar 9, 2017
Messages
26
I am using Windows 7.

I did a repair once before and if I need to reinstall it I will if you think that would help.

Steve, I ran your example and it worked perfect! So I am thinking it might be something with my code.

Can I use you code in my project?

I have never had the need to use Shell before and this old brain is having a hard time wrapping my head around it.

Thanks for the help.

Jim
 
Last edited:

sneuberg

AWF VIP
Local time
Today, 11:39
Joined
Oct 17, 2014
Messages
3,506
Can I use you code in my project?
Of course it was really your code.

Anyway I figured out the late binding problem. I was reading about late binding and it said

Late binding is still useful in situations where the exact interface of an object is not known at design-time. If your application seeks to talk with multiple unknown servers or needs to invoke functions by name (using the Visual Basic 6.0 CallByName function for example) then you need to use late binding.


When I saw CallByName I thought why not give that a try which led me to this page where I saw that the folder has a type of Variant. That was the problem. If you change this

Code:
Public Function getFileMetadata(fileFolder As[COLOR="red"] String[/COLOR], fileNm As String, metadataType As String) As String
to
Code:
Public Function getFileMetadata(fileFolder As [COLOR="red"]Variant[/COLOR], fileNm As String, metadataType As String) As String

It will work with late binding. My test database is attached with this change and late binding
 

Attachments

  • MetaDataUsingShell.accdb
    428 KB · Views: 164

jray9242

Registered User.
Local time
Today, 11:39
Joined
Mar 9, 2017
Messages
26
Steve thank you and THANK you to the others that have helped me here and not making me feel like an idiot.

I haven't used Access like this in years and it's been tuff getting back in the saddle.

It's been fun but head banging at the same time. Just to let you know, I do a lot of research before I post here but appreciate all of it.

Thanks again everyone for the outstanding help!!!

Jim
 

jray9242

Registered User.
Local time
Today, 11:39
Joined
Mar 9, 2017
Messages
26
I wanted to show you all the final product. I still need to do some tweaking but the code is working perfect.

As you can see, because I am using a tabular form, all the fields get populated when I run the code.

I have some ideas but for now I am happy with the direction it is going and much of it is because of you all.

Thanks again!

Jim
 

Attachments

  • 2017-03-19_10-19-45.jpg
    2017-03-19_10-19-45.jpg
    78.5 KB · Views: 187

Users who are viewing this thread

Top Bottom