Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/03/2007, 10:26
tammander
 
Fecha de Ingreso: enero-2006
Ubicación: Torroles (Costa der Só)
Mensajes: 1.017
Antigüedad: 19 años, 3 meses
Puntos: 7
Re: Mostrar una imagen de access en asp

Necesitas tres cosas:

1 - Una tabla con un campo tipo OLE donde esten guardas las imagenes.

2 - Una página ASP que actue de IMAGEN. Este sería su contenido (mas o menos)

Código:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="../Connections/fotos.asp" -->

<% 
    
    response.Expires = 0
    response.Buffer  = True
    response.Clear

    dim id
    id = request("id")
    
    if id <> "" then
    
        Set rs = Server.CreateObject("adodb.recordset")

        strSQL = "select FileData,ContentTyped from fotos where id = " & id

        rs.Open strSQL, MM_fotos_STRING

        response.contentType = rs("ContentTyped")
        response.BinaryWrite rs("FileData")
        rs.Close
    end if
    response.End
%
3 - La página ASP desde la que es llamada la anterior:

Código:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Imagenes</title>
</head>

<body>
....

 <img src="paginaaspparaimagenes.asp?id=<%=rs("fotoid")%>" width="150" height="150" border="0" />
.....
</body>
</html>
Un saludo
__________________
"Tus pecados son el estiércol sobre el que florecerán las flores de tus virtudes" - Gerald Messadié -