Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Take a Photo & Show in Database

Posted on 2014-07-23
5
Medium Priority
?
224 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 668 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 668 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 664 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

926 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