Solved

VB5 - Bound PictureBox Control

Posted on 1997-10-27
1
340 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now