Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/11/2011, 09:30
cazadorpuebla
 
Fecha de Ingreso: octubre-2011
Mensajes: 3
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: extraer objeto ole(pdf)

ya consigo acceder al fichero pero cuando lo voy a visualizar me aparece una página con el formato pdf y en el número de páginas me lo muestra bien, es decir, me muestra el número de paginas que tiene el pdf pero las muestra sin contenido (en blanco). Alguien sabe por qué? Aquí les dejo mi código a ver si saben q estoy haciendo mal:


<%
Dim oConn, strSQL, objRS
Dim ot As String = Request.Params("var")
Dim id_key As String = "Distribucion/99999998/MSCR_104/" + ot



oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/Practica/DocAs99999998.mdb"))
strSQL = "select [BinariFile], [NombreFichero] from DocAsoc where [Key] = '" + id_key + "'"
objRS = oConn.Execute(strSQL)

Dim a() As Byte = objRS.fields("BinariFile").value
Dim NuevaCadenaPDF As String = System.Text.Encoding.ASCII.GetString(a)
Response.Clear()
Response.ClearHeaders()
Response.Buffer = True
Response.ContentType = "application/pdf"
Dim filename As String = objRS.fields("NombreFichero").value.ToString
Response.AddHeader("content-disposition", "inline; filename=" + filename)
Response.Write(NuevaCadenaPDF)
Response.Flush()
Response.End()




objRS.close()
oConn.close()
objRS = Nothing
oConn = Nothing

%>