Displaying a image in asp
hi guys I am trying to get a image to display for each record of a database, each image should relate to each record so there should be diffrent pics for each record im using the following code can any body help me.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Orders</title>
<link href="project.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsOrder 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database
'Create an ADO connection object
Set adoCon =Server.CreateObject("ADODB.Connection")
'Set an active connection to the connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("order.mdb")
'Create an ADO recordset object
Set rsOrder = Server.CreateObject("ADODB.Recordset")
'Initalise the strSQL variables with an SQL statement to query the database
strSQL = "SELECT tblOrders.Firstname, tblOrders.Surname, tblOrders.Telno, tblOrders.Cardno, tblOrders.Item, tblOrders.Itemcode, tblOrders.Qty FROM tblOrders;"
'Open the recordset with the SQL query
rsOrder.Open strSQL, adoCon
'Loop through the recordset
Do While not rsOrder.EOF
'Write the HTML to display the current record in the recordset
Response.Write ("<h1>Order</h1>")
Response.Write ("<br>")
Response.Write("Street: ")
Response.Write (rsOrder("Firstname"))
Response.Write ("<br>")
Response.Write("Number of bedrooms: ")
Response.Write (rsOrder("Surname"))
Response.Write ("<br>")
Response.Write("Duration of Let: ")
Response.Write (rsOrder("Telno"))
Response.Write ("<br>")
Response.Write("Furnished: ")
Response.Write (rsOrder("Cardno"))
Response.Write("<img src='..\images" & rsOrder("Itemcode") & "'>")
Response.Write ("")
'Move to the next record in the recordset
rsOrder.MoveNext
Loop
'Rest server objects
rsOrder.Close
Set rsOrder = Nothing
Set adoCon = Nothing
%>
</body>
</html>
|