Solved

How to Update Graphic Field

Posted on 2001-09-07
4
174 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

810 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