Thanks for the quick reply Albert. I did come across that sample code in
my
searches. However, I am unfamiliar with incorporating vb6 .cls files into
MS
Access (2003) and have not found any tutorials for doing this. Can you
assist.
jim
Sure, I just tried this...and it works like a charm.....
Simply unzip the download.
Now, in the folder, simply open up that file called ExifReader.cls
If you have vb6 installed, it will see it appear as a VB6 class icon, and if
you double click on the file (ExifReader.cls), then the
VB6 development system and editor will launch when you click on it.
If you do NOT have vb6 installed, then when you click on the file
(ExifReader.cls), then you be asked to choose an web service, or the 2nd
option of select the program from a list. (use the 2nd option)
application to open it with
(use notepad) .
When you open the text document, simply place the cursor on the first line,
hold down the shift key, and start hitting the down arrow key.
We need to highlight up to the line:
Option Explicit.
(it is aout 16 lines you have to hight lit)...now, hit the delete key).
If you had vb6 insalled, the first junk would be removed for you..and you
simply cut/paste the code...
So, we delete all stuff up to the line Option Explicit.
Now, go edit->select all.
now edit->copy
We now are now going to paste this code into a ms-accesss CLASS OBJECT
modulete..
Open up the access appcation were you going to use this code.
from the main menu, go
insert->class module
You see:
Option Compare Database
Option Explicit
move your cusor below the above two lines (you might not have the Option
Expclit, but that somtong you should have set in the tools->otipons...we fix
that later).
Now, edit->paste in your code
(if you copied the Option Explit..hten we have it two times...delete one of
them)
now, save (hit the save buttion on teh code editor menu).
THIS NAME we going to give the module will become the name of this class
object code we just pasted.
lets call it
clsExif
After you save it, you should do a debug->compile...make sure all your code
compiles....
Now, in one of your standard code modules, or forms, lets do a test of this
code:
Sub testread()
Dim clsPic As New clsExif
clsPic.picFile = "c:\1.jpg"
Debug.Print clsPic.Tag(ExifImageHeight)
Debug.Print clsPic.Tag(ExifImageWidth)
Debug.Print clsPic.Tag(DateTime)
End Sub
When I run the above, I get:
2304
3072
2007:10:22 19:41:10
I using a 7.2 mp digital camera...
Of course, that means I have a picture called 1.jpg in c:\ (in the root
directory).
Note that I never used this before, but intel-sense WILL show you the "list"
of appropriate volutes in the tag function when you hit the "("...if it does
not , then try pressing ctrl-j...it should pop a list of possible values.
This intel-sense ONLY works if you have no compile errors in your code...
I did the above as I typed these instructions...and it worked the first
time.
It is a nice routine ...and I will save it...as I also have need for a jpeg
picture reading routine....