Results 1 to 5 of 5

Thread: PDF from ASP

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 1999
    Location
    Los Angeles
    Posts
    186
    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:
    Code:
    <% 
    
    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é

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    have you ever seen it done b 4?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 1999
    Location
    Los Angeles
    Posts
    186
    nope!

    André

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Try using rs.Fields("PdfFil").Value
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    or even just rs("PdfFil")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width