Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to Update Graphic Field

Posted on 2001-09-07
4
Medium Priority
?
181 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 40 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses

963 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