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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking to database images....

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
I have an image database which stores the images outside in a folder (and the record id = the image name i.e. 23.jpg). Using ASP I can link to these images on web pages but I cannot do the same in my VB project. The code that I've been trying is:

file = txtImgID.Text
imgImageThumb.Picture = "\\idcnt2\netvisual$\thumbnails\thmb_" & file & "." & "jpg"

Also, where do I put the command so that the image box updates itself (displays the new thumbnail image for the new latest) when the record changes through the ADO control?

Thanks...
 
1. If you want to display jpg-files use VBScript (LoadPicture).
2. What ADO control do you use?

Herman :-Q
 
I'm using Microsoft ADO Data Control 6.0....

Will LoadPicture update along with the record changing???

Thank you....
 
No, because the picture/image box in VB is not databound. You will have to track changes. The WillMove event of the datacontrol is called before the current position in the recordset changes, the MoveComplete event is called after the change.

Success, Herman :-Q
 
Oops, I was wrong with that one. You can specify a datasource. However I've never tried it.

Sorry, Herman :-Q
 
Well, just another update. Since you haven't stored the picture in the database but only the reference, I think you'll have to track the record change using the above described events and display the picture using the loadpicture function (picture1.picture = loadpicture(filename)). The loadpicture function supports jpg files as well.

Hope this helps.

Herman :-Q
 
Can I tack a graphics question on this thread, please?

I have written a project where people are tracked by lots of different attributes....including a picture or two. I am using ADO, but my controls are unbound. I figure I will use an Image control to store the picture on the form. And I know that I need to have a LongBinary datatype in the Access DB. I just can't seem to find info on how to programmically load the picture from the DB and save from the Image control to the DB. Also, I would like to be able to 'cut&paste' the image from, say, scanner software.

Any direction/help will be greatly appreciated.

Tom Snider
San Antonio, Texas
 
Hi Tom,

the topic (storing images in db) is discussed in another thread just a few days ago. But I cannot find it since the keyword search is still not working. Maybe it's in FAQ also.

Herman :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top