Help,
The blob image is not populating in the asp page help.
<%
Dim oConn
Dim oRs
Dim sSQL
Dim nFileID
DIM RECB
nFileID = Request.QueryString("FileID")
'If Not nFileID = "" And IsNumeric(nFileID) Then
Set oConn = Server.CreateObject("ADODB.Connection")
Set oRs = Server.CreateObject("ADODB.Recordset")
' Sometimes I personally have errors with one method on different servers, but the other works.
'oConn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("Files.mdb")
'oConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Files.mdb")
'sSQL = "SELECT FileName, ContentType, BinaryData FROM Files WHERE FileID = " & Request.QueryString("FileID")
sSQL = "SELECT Picture FROM [ACME LTD$employee] WHERE [No_] = '0001'"
'Dconn.Open sSQL, XConn, 3, 3
set RECB = DCONN.Execute(sSQL)
If Not RECB.EOF Then
'Response.ContentType = RECB(1)
'Response.BinaryWrite RECB(2)
Response.ContentType = "image/bmp"
Response.BinaryWrite Recb("Picture").Value
Else
Response.Write("File could not be found")
End If
'oRs.Close
'oConn.Close
'Set oRs = Nothing
'Set oConn = Nothing
'Else
' Response.Write("File could not be found")
'End If
%>
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.