Solved

Northwind Database and you!

Posted on 1999-01-29
5
153 Views
Last Modified: 2013-12-25
I've made a simple Visual Basic 5.0 project, which consists of a form, a database control, and a picturebox control.
Data1 Control Properties
Databasename: Northwnd.mdb
RecordSource: Categories

PictureBox1 Control Properties
DataSource: Data1
DataField: Picture

Now, in theory, I should be able to use the data control to scroll through the pictures in the database, which will appear in the picture box, but what happens, is I get an "invalid picture" error.

Now, when I open the Northwnd.mdb database, I notice that the pictures, are merely ole bitmap image objects, and what appears in the field, is "bitmap image", and not the actual image.  This could be my problem, but does anyone know how to remedy this, so I can view the images through the picturebox, and not get the error?

Thanks.
0
Comment
Question by:frankbrack
  • 3
5 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 1499630
Try the Data form wizard. It will generate it for you. You will have to resize the control, but it will work!


0
 

Author Comment

by:frankbrack
ID: 1499631
I'm sorry, I guess I would like an explanation as to why my doesn't work, and then how to correct it manually.
0
 

Author Comment

by:frankbrack
ID: 1499632
I'm sorry, I guess I would like an explanation, as to why, my way, doesn't work, and I would like to know how to correct, what I've got so far, manually.

When you view the bitmap image's in the access database, it doesn't physically show the image, in the table, but rather it has a link, that when double clicked, will open the image, in MS Paint.  What's going on here?
0
 
LVL 18

Accepted Solution

by:
mdougan earned 200 total points
ID: 1499633
Instead of using a picture box, instead use an ole object.  When the wizard asks you what kind of ole object, tell it a BMP, and to create a New BMP (as opposed to creating from a file).  Set the normal DataSource and DataField properties and it will work.

What is going on here is, as you suspected, the data has been saved in the Access database as an ole object -- so, it makes sense that you can only view it by using an ole control.  

MD
0
 

Author Comment

by:frankbrack
ID: 1499634
Hi emoreau,
I figured this one out after playing with it.  Using the ole object works perfectly.

But your answer is correct, so I will award you the points.  Thanks.
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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

756 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