INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

UPLOAD PICTURE, etc...

UPLOAD PICTURE, etc...

(OP)
Need Help Please.
A - S - A - P

I Need This Tomorrow T_T

Please tell me or post here.
on How to

Display the UPLOADED picture on Another Form.

------------------------

FORM1 DESIGN

1 IMAGE BOX
1 COMMAND BUTTON "UPLOAD PICTURE"
1 COMMAND BUTTON "VIEW PROFILE"


FORM1 CODE:

cmdupload_click()

'UPLOAD THE PICTURE ON IMGBOX (obviousLy)
'dont know the code here

'i also need to save this on DATABASE
'i am using Microsoft access

end sub


----------------------------------------------------------

DATABASE / MICROSOFT ACCESS

Field Name: Image
DATATYPE : OLE OBJECT


----------------------------------------------------------

cmdview_click()

Form2.Show
Me.Hide

Form2.Img1.picture = Adodc1.Recordset!Image

'100% NOT SURE ABOUT THIS CODE

end sub





--------------------------------

Form2 Design

1 Image Box
1 Label "Profile Picture"


-------------------------------------

I'll Be Waiting For The Response Today. :'(

Any Kind Of Help Would Be VERY Much
APPRECiATED. Thanks ....... :(


RE: UPLOAD PICTURE, etc...

Upload from where? A web site?

The point being that you have not really provided us with sufficient specs to comment (tt is not a code-writing shop)

Also, this looks exceedingly like homework.

RE: UPLOAD PICTURE, etc...

(OP)
OUR SYSTEM IS LAN BASE


UPLOAD FROM COMPUTER

RE: UPLOAD PICTURE, etc...

(OP)
And Im using ADODC Database (MicrosoftAccess)

If You Know A Code With Adodb.
Please Do Share,, Tnx

RE: UPLOAD PICTURE, etc...

Can I just confirm: you've sent a completely empty project? Just a couple of forms with some controls on. And you are expecting people here to fill in all the blanks with code? I'm afraid that you'll be disappointed. We'll help people, but not do it all for them.

RE: UPLOAD PICTURE, etc...

If there is any "uploading" involved here the where to seems to matter more than the where from, since uploading implies the from (i.e. from "here" the local PC). But I suppose the image might have been created within the program, fetched from a scanner or camera, etc. and thus in memory rather than on disk.

Sounds more like the question is about storing images in the database though, and not "uploading" at all.

RE: UPLOAD PICTURE, etc...

(OP)
MAIN PROBLEM!



HOW TO SHOW THE SAVED PICTURE ON DATABASE TO ANOTHER FORM ? ? ?


THATS ALL I NEED GUYS, please...
Our Defense Is After 5 Hrs..
Please, AnyOne . . . . -.- :(

RE: UPLOAD PICTURE, etc...

(OP)
THIS IS MY FIRST TIME USING FORUMS OF VB
TO ASK FOR CODES.

CAN ANYONE JUST KINDLY HELP ME.
IT WOULD BE VERY MUCH APPRECIATED. :(

RE: UPLOAD PICTURE, etc...

Did you try searching this forum. The question of extracting an image from Access has come up several times/ Here's one example of the standard technique, using GetChunk and an intermediary file: thread222-622728: Images in report. Additional searching should find improved methods (particularly ones that avoid the use of the intermediary file). In addition, it can depend on the version of Accesss that you are using. Later versions include the Attachment column data type, which lends itself to alternative methods.

RE: UPLOAD PICTURE, etc...

GetChunk is pretty obsolete, being a leftover from ADO 2.0 and 2.1 and rarely required anymore. Its main reason for existance stems from classic ASP and machines with under 512MB of RAM, where an image-delivering ASP page is just pipelining the data to a browser and has no use for the entire BLOB in one piece.

There is also the question of the data format to be stored into Jet fields of type IMAGE, LONGBINARY, GENERAL, and OLEOBJECT (aliases for the same thing). Many data-bound image controls prefer the raw BLOB in a supported image file format (BMP, JPEG, GIF) and fail if you mistakenly store persisted StdPicture streams. This is also quite viable since we have WIA 2.0 now, which can easily create a StdPicture from such as disk-image BLOB for scenarios where data binding isn't used.

I suggest you throw away the ADODC and either use ADO code or else a DataEnvironment. The ADODC was meant for very simple situations.

RE: UPLOAD PICTURE, etc...

Not quite sure that I agree that GetChunk is obsolete just yet ...

RE: UPLOAD PICTURE, etc...

Well as it says in the docs:

Quote:

In situations where system memory is limited, you can use the GetChunk method to manipulate long values in portions, rather than in their entirety.

This is rare unless you are streaming the data somewhere, and in multiuser server situations it makes sense to limit the amount of RAM tied up to service each request.

Aside from that though you can just use the Field's Value, especially if you need the entire thing ayway. As far as I can recall you have to go all the way back to ADO 2.0 or so before GetChunk is required for BLOB data retrieval. Of course it may be true that some Providers do not support direct BLOB access even today, so you may still find uses for AppendChunk and GetChunk.

Perhaps people get into trouble by being sloppy and relying on the Field object's default property being Value. Through poor habits they omit it and get into trouble when they're retrieving a persisted object:

CODE

Set SomePic = RS("PicField") 

Instead of:

CODE

Set SomePic = RS("PicField").Value 

However using Jet 4.0 and ADO 2.5 or later with IMAGE fields for local consumption (display) there is no need to GetChunk through the BLOB.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close