|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Can anybody give me the code to display image from a database (Access / MS SQL) using ASP.
I believe it the displaying page should look somthing like this <img src="get.asp?name='christine'"> whats supposed to be the code in the get.asp file? Any help would be appreciated and rewarded. Thanx Kiran |
|
#2
|
|||
|
|||
|
i love u
|
|
#3
|
|||
|
|||
|
Code:
<%
dim ImageID
dim Image
ImageID = request.querystring("ID")
if ImageID <> "" then
set Connection = server.createobject("ADODB.Connection")
Connection.Open "DatabaseDSN", "UserName", "Password"
set Result = server.createobject("ADODB.Recordset")
sql = "SELECT ImageData FROM Images WHERE ImageID=" & ImageID
Result.Open sql, Connection, adOpenKeyset
if not (Result.eof and Result.bof) then
Image = Result("ImageData").GetChunk(1024000)
Response.ContentType = "image/gif"
Response.BinaryWrite Image
else
Response.Write "ID '" & ImageID & "' not found in DB."
end if
Result.Close
Connection.Close
else
Response.Write "ID is blank "
end if
Response.End
%>
http://www.15seconds.com/faq/ASP%201.0/622.htm |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > displaying images from access / ms sql using ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|