PDA

Click to See Complete Forum and Search --> : PDF from ASP


André
Nov 24th, 2000, 01:10 AM
Hello everyone,
I am having problems in showing a pdf file from ASP.
Ihave a component that queries a database where the pdf file is.

Then I call the method from ASP as follows:

<%

Dim KategoriID, rs, objVarer

Response.Expires = 0
Response.Buffer = TRUE

KategoriID=1030108

set objVarer = Server.CreateObject("VarerOnline.HentVarer")

set rs = Server.CreateObject("ADODB.Recordset")

set rs = objVarer.HentPdfFil(Clng(KategoriID))

if not rs.EOF then
Response.ContentType = "application/pdf"
Response.BinaryWrite rs.Fields("PdfFil")
end if
%>

I have something in my recordset, but the page fails at the line Response.BinaryWrite rs.Fields("PdfFil") with a type mismatch error.

Do you know how to solve this? ressources where I can find help? I've searched and searched but found nothing.

Please help,

Thanks in advance,

André

da_silvy
Nov 24th, 2000, 08:31 PM
have you ever seen it done b 4?

André
Nov 25th, 2000, 09:12 AM
nope!

André

parksie
Nov 25th, 2000, 09:48 AM
Try using rs.Fields("PdfFil").Value

da_silvy
Nov 26th, 2000, 03:16 AM
or even just rs("PdfFil")