Solved

Take a Photo & Show in Database

Posted on 2014-07-23
5
216 Views
Last Modified: 2014-08-03
Hi,

I need assistance to automate taking a photograph using a webcam (or a camera attached to my pc) & "attaching" same to my database.
The image is not embedded into the database.

The ffg. (only relevant table fields) are listed:

tblEmployees
EmployeeID      AutoNumber
EmployeeImageFilePathAndName   Text


 frmEmployees has imgEmployeePhoto which has tblEmployee.EmployeeImageFilePathAndName as it's Control Source.

The Employee's  JPEG photo would be stored at C:\Project1\EmployeePhotos

The naming of Employee's photo would be: "EmployeeID yyyy-mm-dd hh:mm:ss"

The process should be:
Step 1: Take the photo | Name the photo and store to disk
Step 2:  Parse the EmployeeID and write the File Path and Name to tblEmployee.EmployeeImageFilePathAndName
Step 3: Refresh/Requery frmEmployees so that the Employee photo shows.

Your assistance in this would be greatly appreciated.

Kind Regards,
Mohamed
0
Comment
Question by:Mohamed Singh
5 Comments
 
LVL 4

Accepted Solution

by:
Jack Leach earned 167 total points
ID: 40214723
Hi,

I don't have many details handy at the moment, but as a general guideline you're going to look at the WIA library (Microsoft Windows Image Acquisition), which allows you to interact with scanners, cameras, devices, etc.  

The work I've done with it was for automating scanning and pulling existing images from a camera: I'm unsure offhand if it has the capability to instruct the camera to actually take the picture.

You can set a reference to the Microsoft Windows Image Acquisition library from your VBA references (c:\windows\system32\wiaaut.dll) and start playing around there... the MSDN documentation is in pretty good shape as well (or at least, it was last time I used it).

http://msdn.microsoft.com/en-us/library/windows/desktop/ms630368(v=vs.85).aspx

Note that older devices (e.g., more than 10 years old at this point), may not support WIA.
0
 
LVL 3

Assisted Solution

by:tbrent77
tbrent77 earned 167 total points
ID: 40216790
If you don't have time to learn WIA as mentioned above, you could simply write your application to get the picture name just taken by searching the folder for the newest date or something and adding it to your database.  Renaming it in the process to fit your needs.  So the operator could take the picture, and its stored automatically in a folder.  From there, the operator would type in the employee ID/name (in your software) and from there, the program could find the latest photo in the folder by date / time and rename it and then store the path in your database.  I realize you would have two programs running, but its a lot faster than writing WIA code unless you are already familiar with it.  The WIA library is your only other option, and its the best way to integrate it with your system from an operator standpoint.  I just suggest an alternative if you have time limits.  Most webcams, scanners, and cameras are wia compliant but not all.  Usually its the off brand models that don't work.

One last note, this type of software has been made many times.  I used to install a similar product made for Jail bookings.  When someone was arrested, the were booked and that meant taking a picture and cataloging it.  This might be an alternative to writing code.  Google "jail booking software" and you will see dozens.
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 166 total points
ID: 40225860
Yes,...
why re-invent the wheel.

I believe this popular product does all that you are requesting here:
http://www.ammara.com/dbpix/access.html

It is specifically designed to work with images in MS Access.

JeffCoachman
0
 

Author Comment

by:Mohamed Singh
ID: 40226167
Thank You Jack Leach, tbrent77 and Jeff coachman for responding.  All your advices have been taken.  Exploring WIA was certainly beneficial in getting to known the methods,  properties etc.  Going with JeffCoachman's suggestion was helpful in finding another excellent (& lesser expensive) ready - made solution at http://access.bukrek.net.  However,  I only got to this by researching WIA in; so Thanks to you all.  Now which do I select as the accepted solution ?????!!! Kindest Regards,  
Mohamed
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40227738
Well, as for me...

I am just glad you were able to find a solution that works for you.

You can certainly accept all three posts (multiple solutions)

But I wont feel bad if you just accepted the solutions by the first two experts..
;-)

JeffCoachman
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question