5 replies
by lwe
by shibu
by tdavenport
Images in a DB have various pros and cons but it is easy enough to do.
ID = Request.QueryString("ID")
BlockSize = 4096
Response.ContentType = "image/JPEG"
strQuery = "SELECT * FROM Blob WHERE Blob_ID = " & ID
Set oRS = oConn.Execute(strQuery) 'oConn is a Session level object
oRS.MoveFirst
Set Field = oRS("Blob")
FileLength = Field.ActualSize
NumBlocks = FileLength \ BlockSize
LeftOver = FileLength Mod BlockSize
Response.BinaryWrite Field.GetChunk(LeftOver)
For intLoop = 1 To NumBlocks
Response.BinaryWrite Field.GetChunk(BlockSize)
Next
oRS.Close
You can find complete information on this subject at MSDN.Microsoft.com search for image and SQL
by shibu
by shibu
This discussion is closed to new replies.
Trending Desktop posts
Sort by Trending