Solved

Take a Photo & Show in Database

Posted on 2014-07-23
5
215 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

856 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