[thelist] Inserting PDF from SQL Server into web page

Miller, Bart MillerB at bek.com
Wed Jul 19 14:26:00 CDT 2000

I am using the following code attempting to read PDF data from SQL Server
and write it out to a web page:

<% Response.ContentType = "application/pdf" %>
<!--#include virtual="ADO_connect.asp"-->
Response.Buffer = True
Query = "SELECT pdf FROM table1 WHERE id =  " & chr(39) &
Request.QueryString ("pdf_id") & chr(39)
Set RS=MyConn.Execute(Query)

Response.BinaryWrite  RS("pdf")

But all I get is a page full of garbage -- however it does appears to
contain data from the PDF file.  Any ASP gurus want to take a stab at this?

More information about the thelist mailing list