ASP - image(BLOB) sql server not showing image correctly ???

NAVKINGNAVKING Member Posts: 9
edited 2005-10-26 in Navision Attain
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
%>

Comments

  • kinekine Member Posts: 12,562
    You need to disable compression on this BLOB field to be able to use it outside Navision... see property "Compressed" on this field...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.