I am trying to display images that would have been uploaded to an access database using an access form. The data entry is done in access. asp is being used to peruse the database. Based on my research I should pull the images out on one page and then refer to this page using html embed syntax. However I am not sure how good this works cause the first page is not even displaying the image. Thus far this is the code for the page that is supposed to pull out the image:
Code:
Dim adoCon 'Holds the Database Connection Object
Dim serVisit 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database
countn = 0
Response.Expires = 0
Response.Buffer = TRUE
Response.Clear
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("FirmDataEntries.mdb")
Set rs = adoCon.Execute("SELECT Photograph FROM Offtbl WHERE OfficerName='JAMES BROWN'")
Response.ContentType = "image/gif"
Response.BinaryWrite rs("Photograph")
rs.Close
Set rs = Nothing
adoCon.Close
Set adoCon = Nothing
Response.End
Now the funny thing is that when I load the page in the "status" bar it reads donwloading from page etc..... The name of the page. But when its finished all you see is the broken icon which represents that an images is supposed to be displayed but some error has happened so nothing displayed. Something like what you get when you have an incorrect path to the image in your html. Would appreciate some help on this. Also future recommendations on a more stable platform for viewing pictures from a db.