<%
SET RS = conn.execute ("SELECT * from Youtable")
Set ofilestream = CreateObject ("AdoDb.Stream")
OfileStream.Type = 1
Set id = rs ("id")
SETO = RS ("photo")
Do while rs.eof = false
OfileStream.open
OfileStream.write photo.value
OfileStream.savetofile "D: / Photo" & id & ". JPG", 2
OfileStream.close
rs.movenext
loop
Set ofilestream = Nothing
SET Photo = Nothing
Set id = Nothing
Rs.close
SET RS = Nothing
Call CloseDatabase ()
%>