Solved

Take a Photo & Show in Database

Posted on 2014-07-23
5
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

710 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