Solved

How to Update Graphic Field

Posted on 2001-09-07
4
171 Views
Last Modified: 2012-05-04
Hi all,

Currently i have project need to store a graphic(product picture ) into my the database, the database i using is oracle 8i in Windows 200/98 platform.

Question

1. When using visual baic to create a interface for user to input data, for graphic field i support to use image or picture box any different them ?

2. When user input input data , how can i get the resouirce (picture) and put into image box.
Eg : 1)direct scan from scanner and load into image box.
     2) PoP a message box and ask user to find the
        picture and then load into image box.

Any suggestion can get load the picture into image box ?

3. Before i can load the picture into the image box , is it i need to cut the size of picture according to the image box size ?

4. When update data field , for graphic is it any different or just like the normal field ?


Hope you can understand what i mean .

Could you please give me some example .


Thanks










   
 












0
Comment
Question by:seemedp
4 Comments
 
LVL 3

Accepted Solution

by:
RodStephens earned 10 total points
ID: 6466745
> 1. When using visual baic to create a interface for
> user to input data, for graphic field i support
> to use image or picture box any different them ?

You can use a PictureBox linked to the database field using a Data control. Or you can save and load the image yourself. Or you can keep the files separate and store the file names in the database.

> 2. When user input input data , how can i get the
> resouirce (picture) and put into image box.
> Eg : 1)direct scan from scanner and load into image box.
>    2) PoP a message box and ask user to find the
>       picture and then load into image box.

2 is easier. After the user selects the file, just use:

    Picture1.Picture = LoadPicture(the_file_name)

> 3. Before i can load the picture into the image box ,
> is it i need to cut the size of picture according
> to the image box size ?

If so, load it first into a PictureBox with Visible = False and AutoSize = True. Then use PaintPicture to copy it into the display PictureBox at the right size. Be sure to keep the same width/height ratio in the new picture so you don't squash the image.

> 4. When update data field , for graphic is it any
> different or just like the normal field ?

If you link the PictureBox to a Data control, it will work normally without any work on your part.

> Could you please give me some example .

Take a look at:

    http://www.vb-helper.com/HowTo/dbpict.zip
    http://www.vb-helper.com/HowTo/dbimage.zip
    http://www.vb-helper.com/HowTo/dbimage2.zip

My book "Advanced Visual Basic Techniques" shows how to make an application that does this using a PictureBox linked to a Data control. It's a bit old now, though.
0
 

Author Comment

by:seemedp
ID: 6481664
hi Rodstepphens,


I have using the ADO data control to link with my database, but when i try to link datafield with my database vb has pop out error "datatype not supported".


Tablet field setting ( oracle 81)
field 1 varchar(20)
field 2 varchar(30)
field 3 longrow

is it the vb cannot support datatype longrow ?

Like this situation , where i can get detail or confimation for thsi error.


Thank you.  








0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7207745
Hi seemedp,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept RodStephens's comment(s) as an answer.

seemedp, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7241088
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

707 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

12 Experts available now in Live!

Get 1:1 Help Now