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

NAVKING
Member Posts: 9
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
%>
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
-
You need to disable compression on this BLOB field to be able to use it outside Navision... see property "Compressed" on this field...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions