Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Take a Photo & Show in Database

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
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.
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…

722 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