Help w/ coding tips. BLOB images being displayed

B

bfiser

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top