Revision History
Site Map

Graph: dbPix image storage vs OLE Embedding and Linking in Microsoft Access

Camera Control in Access with WIA

WIA (Windows Image Acquisition) allows you to take control of digital cameras to create highly automated and easy-to-use applications. WIA works with 'tethered' cameras (connected by cable or wireless link), allowing users to retrieve photos from the camera, take pictures by remote control, clean-up pictures from the camera's memory, and more. Intuitive dialogs are available for selecting images, and the application can respond directly to camera events to further automate camera workflows.

Download Sample   642 KB


sample screenshot - Camera Control in Access with WIA
Capture Form
sample screenshot - click to enlarge
Get Photos
sample screenshot - click to enlarge

System Requirements

Windows XP SP1 or later.
Digital Camera with WIA Drivers.
WIA Automation component (installed automatically by sample if not present).
DBPix 2.0 Image Control (installed automatically by sample if not present).


Unzip the archive.


Before using this sample we strongly recommend that you prepare a camera with some unimportant test images, or that you first backup images from the camera. Read the information below and the notes on the sample forms fully.

Open the mdb file. The 'Switchboard' form opens automatically, and detects and installs the required components as necessary (WIA automation, and the DBPix image control). The 'Status' display shows the result of OS version and component checks.

Once the components are installed click the 'Open Capture Form' button. The Capture form opens and detects available cameras and camera capabilities (once the form is open the camera list will update if cameras are connected or disconnected).

If your camera isn't listed, check that it is connected and switched on, and that the cameras' WIA drivers are installed. Some cameras need to be placed in a specific mode to support tethered operation (e.g. 'Playback' mode).

Once a camera is selected the forms' buttons are enabled according to the cameras' capabilities.

Click 'Retrieve a Photo' to select a photo using the common camera dialog. Select a thumbnail and click 'Get Picture' to retrieve the picture and store it in the current record.

Click 'Retrieve All Photos' to retrieve all photos from the camera. Each photo is added to a new record.

If the selected camera supports 'Take Picture' ('Remote Release') you can click 'Take Picture' to take a new photo, retrieve the photo and store it in the current record. The 'Take Picture' button is only enabled if the camera reports that it supports this function.

With all the actions above you can optionally check the 'Delete retrieved images from camera' checkbox to delete images from the camera's memory card after they have been retrieved. Use this option with extreme care - the photos will be permanently deleted from the camera (and note that by default the photo stored in the database is a reduced resolution copy) - we strongly suggest using only unimportant test images while evaluating this sample.

After retrieving some images you can review them by scrolling through the form. Right-click the image to see available tools. Choose 'Image Info' to display information about the current image, including EXIF tags.

Images are stored in the 'tblImages' table. As well as the image itself, the sample also stores additional image properties (the EXIF 'Date Taken value', and the original filename of the image on the camera memory card). Many additional image information properties are available via WIA, and could be stored in the table as images are retrieved.

Technical Overview

WIA is a device independent library that provides programmatic control of a range of digital cameras from many manufacturers. This sample uses WIA 2.0, and consequently requires Windows XP with Service Pack 1 or later. WIA 2.0 is implemented in a single self-registering dll which is included in the sample. The sample will detect if WIA installation is required, and then extract and install WIA as necessary.

To use WIA a digital camera with WIA drivers is required. WIA drivers are supplied by the camera manufacturer, and must be installed before this sample can be used. WIA drivers are available for most recent digital cameras.

Finally, before the camera can be controlled, it must be connected to the computer (or 'tethered'), and placed in a mode in which remote control is possible. The camera is typically connected using a USB or Firewire cable, or over a WiFi or Bluetooth wireless link.

Files & Code

File / module Description  

frmCapture WIA Camera Control Code View Code
WIAConstants Constants used in WIA code View Code