Reviewing my code. Displaying a BLOB image through a browser
- From: bfiser@xxxxxxxxx
- Date: 20 Dec 2006 05:12:36 -0800
I need to display a blob image from a database through my web browser
and I am struggling big. Below you will see the error message I'm
getting as well as my code for ASP and my HTML code. Any advice is
greatly appreciated. Thanks
This is the error I get when I try to open my asp page. When I try to
open the HTML page that uses the ASP page as a source for my image I
get a box for an image but it has the icon for a broken image.
Technical Information (for support personnel)
· Error Type:
Server object, ASP 0177 (0x800401F3)
Invalid class string
/ben/bam3.asp, line 11
· Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
1.1.4322)
· Page:
GET /ben/bam3.asp
· Time:
Tuesday, December 19, 2006, 11:12:49 AM
· More information:
Microsoft Support
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Below is my code. I modified some code I found at 4guysfromrolla.com
I am trying to use an ASP page to grab a binary image from a database.
My Table is called A_870211EE_7122_4AB3_B513_96B2AA58447A
The Column within the table where the images are stored is AF_Photo_1
The column where I define which employee gets their picture shown is
AF_Employee_Number
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<html>
<head>
<title>Displaying Pic from DB</title>
</head>
<body bgcolor="white" text="black">
<%
Dim iAF_Employee_Number
iAF_Employee_Number = Request.QueryString("AF_Employee_Number")
Dim objConn, objRS, strSQL
strSQL = "SELECT AF_Photo_1 FROM
A_870211EE_7122_4AB3_B513_96B2AA58447A WHERE AF_Employee_Number = " &
iAF_Employee_Number
Set objConn = Server.CreateObject("ODBC.Connection")
objConn.Open "DSN=AsureIDc51Test", "xx", "xxxxx" ß username and
password removed for security
Set objRS = Server.CreateObject("ODBC.Recordset")
objRS.Open strSQL, objConn
Response.ContentType = "image/jpeg"
Response.BinaryWrite objRS("AF_Photo_1")
%>
</body>
</html>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This is the code for my HTML page calling to get an employee's photo
based on their id.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<img src="bam3.asp?AF_Employee_Number=301867">
</body>
</html>
.
- Follow-Ups:
- Re: Reviewing my code. Displaying a BLOB image through a browser
- From: Bob Barrows [MVP]
- Re: Reviewing my code. Displaying a BLOB image through a browser
- Prev by Date: Re: data access
- Next by Date: Re: Reviewing my code. Displaying a BLOB image through a browser
- Previous by thread: data access
- Next by thread: Re: Reviewing my code. Displaying a BLOB image through a browser
- Index(es):
Relevant Pages
|