Solved

VB5 - Bound PictureBox Control

Posted on 1997-10-27
1
356 Views
Last Modified: 2013-11-26
Hello all,

I have noticed the properties for a picturebox control that allow the programmer to bind it to a recordset control (datafield and datasource).  I have a sample database (Access version 2) with a table containing a field of type "Ole Object" containing bitmap data.

I thought that if I bound a picture box to this field in a recordset that it would display the image stored in the database when moving throughout the dataset.  I was wrong.  

What can you do realistically with the datafield and datasource properties of a picturebox?  In other words, what is the intened use of these properties?  Is there an way to bind a picture box control to a database containing images so that when moving through the dataset, you can easily browse the images in the database?

Thanks,

Robert
867-5309
0
Comment
Question by:lankford
[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
1 Comment
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
ID: 1438956
The only way we've ever found load the picture property is through the use of the loadpicture function:

PicBox.Picture=LoadPicture("C:\Pict.bmp")  

Which means you have to getchunk out the bmp, write it to a file, then use the loadpicture function to set the .picture property of your picture box.

Using the .datafield and .recordsource properties of the picturebox, you can generalize a function to get the image from the database to a file, then loadpicture it into the picture property.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

737 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