Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPLOAD PICTURE, etc...

Status
Not open for further replies.

asazes

Programmer
Oct 14, 2014
6
PH
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 ....... :(


 
 http://files.engineering.com/getfile.aspx?folder=d0e8b1c1-e5bc-40fa-952b-fb0ecdc80da1&file=zzzz.JPG
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.
 
OUR SYSTEM IS LAN BASE


UPLOAD FROM COMPUTER
 
And Im using ADODC Database (MicrosoftAccess)

If You Know A Code With Adodb.
Please Do Share,, Tnx
 
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.
 
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.
 
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 . . . . -.- :(
 
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. :(
 
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. 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.
 
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.
 
Not quite sure that I agree that GetChunk is obsolete just yet ...
 
Well as it says in the docs:

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top