Tutorials on using database images in ASP?

Results 1 to 2 of 2

Thread: Tutorials on using database images in ASP?

  1. #1
    daveschool Guest

    Default Tutorials on using database images in ASP?

    Can anyone suggest sites to help an ASP newbie learn how to put .jpg images from an Access db into an ASP page? Pleeeeease. Ta.

  2. #2
    Join Date
    Dec 1969

    Default RE: Tutorials on using database images in ASP?

    First question .....<BR>Are you able to work with databases and ASP at present ?<BR><BR>IF you are then it is really easy....<BR><BR>all you need to do is have the name of your jpg in your database field. <BR><BR>Lets say that your Field name is "Images" in the images field you have your jpg names<BR><BR>Me.jpg<BR>Them.jpg<BR>Us.jpg<BR>Other s.jpg<BR>yakityYak.jpg<BR>BlahBlah.jpg<BR><BR>Get the idea ? HeHeHe<BR><BR>Anyhow when you extract the field data you would normaly do something like this (I am not going to put in any Html Table info)<BR><BR><BR>Select table_name.images from table_name where images = My.jpg<BR><BR>&#039Output asp source would look like this...<BR><BR>&#060;%=MyRs("images")%&#062;<BR><B R>&#039What you would get on your html page provided the record exists<BR><BR>My.jpg<BR><BR>&#039So what ! AHA here is where the trick is... you have to incorparate this returned information into a standard html img tag. <BR><BR>To display My.jpg as an image would be done like this on a normal html page...<BR><BR><BR>&#060;img src="/graphics_dir/My.jpg"&#062; <BR><BR>Still with me ? <BR><BR>Now all you do is incorparate your asp into this<BR><BR>&#060;img src="/graphics_dir/&#060;%=MyRs("Images")%&#062;"&#062;<BR><BR>Rememb er &#060;%=MyRs("Images")%&#062; is a variable determined by your search criteria, In this case it is equal to My.Jpg<BR><BR>So you are not actually storing the images in the database you are referencing them via normal html exactly as you would in an html page. Because the ASP section of your image tag will change according to your search criteria so will your image.<BR><BR>Viola a dynamic html page same page different content.<BR><BR>Ta daaaaaa<BR><BR>IF YOU ARE NOT ABLE TO CONNECT A DATABASE USING ASP....<BR><BR>Then that is the first thing you need to learn is how to do so <BR><BR>I have learnt ASP in two ways, I did a basic course of 4 days and did a lot of surfing. I would reccomend some kind of book if you are at the very beginer stages. I have seen one called ASP in 21 days and a couple of others. Sure it may cost a bit but the knowledge you will gain will be worth every penny.<BR><BR>I hope I was of help <BR><BR>Dwane Lumley

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts