Solved

Northwind Database and you!

Posted on 1999-01-29
5
149 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 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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 …
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…

728 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

15 Experts available now in Live!

Get 1:1 Help Now