Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Linking & Retrieivng Images in Access Database


Message #1 by "Sati Bedaysee" <sbedaysee@b...> on Tue, 15 Jan 2002 14:20:46
I have a number of images that I want to link to an Access database. I do 

not want to embed them into as there are too many and the database will be 

too large in size! I have added a path to where the images reside in the 

releveant field e.g images\picture1.jpg. 



Using UltraDev I have created a recordset to display the contents of the 

database table onto the web page but would also like to retrieve the image 

that the path in the database's table relates to.



Can anyonE tell me how do I do this???



Thanks!
Message #2 by "Auratius February" <af1@c...> on Wed, 16 Jan 2002 06:17:26
Hi there



The solution you are looking for is the next.





Dim Cn

Dim Rs



Set Cn = Server.CreateObject("AdoDB.Connection")

Cn.Open ConnectionString...



Set Rs = Server.CreateObject("AdoDB.Recordset")

Rs.Open "Select * from Images" , Cn



If Rs.EOF or Rs.BOF then

   Response.write "End of File"

else

   Rs.MoveFirst

   While not Rs.EOF

       Response.write RS.Fields("Name") & "<img src=" & Rs.Fields("Path")&_

                      ">"

   Rs.MoveNext

   wend

end if



Set Rs = nothing

Set Cn = nothing





I hope this will help



Regards



Auratius

   

             




  Return to Index