Jesse26
asked on
code problem
I am trying to make this recordset have two different uses,
one that shows an image and
two i want link the image per record to a page.
In this case The_Empire_Store_gear.asp
Here is the recordset code but it doesnt work. Any ideas?
<a href="The_Empire_Store_Gea r.asp"<img src="<%=(Recordset1.Fields .Item("Pic ture").Val ue)%>"></a ></div></t d>
</tr>
one that shows an image and
two i want link the image per record to a page.
In this case The_Empire_Store_gear.asp
Here is the recordset code but it doesnt work. Any ideas?
<a href="The_Empire_Store_Gea
</tr>
ASKER
What can i give you to aid in the lookup? I am not really sure what type of variable to use. I want to show all the records in this table. When I replaced the code the page blew up.
Post the page code, including the ASP...
ASKER
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/Empire.a sp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB .Recordset ")
Recordset1.ActiveConnectio n = MM_Empire_STRING
Recordset1.Source = "SELECT * FROM Store ORDER BY CatagoryID ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Empire Volleyball Club</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(p arseInt(ap pVersion)= =4)) {
document.MM_pgW=innerWidth ; document.MM_pgH=innerHeigh t; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_p gW || innerHeight!=document.MM_p gH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
body {
background-color: #000000;
}
.style3 {font-family: "Copperplate Gothic Bold"}
.style5 {font-family: "Copperplate Gothic Bold"; font-size: 14px; }
-->
</style></head>
<body>
<table width="850" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr bgcolor="#FFFFFF">
<td width="234" height="210"><img src="Top/EmpireShadow250x2 50.gif" width="234" height="206" hspace="0" vspace="0"> </td>
<td colspan="4"><object classid="clsid:D27CDB6E-AE 6D-11cf-96 B8-4445535 40000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="725" height="210">
<param name="movie" value="Top/Empirevolleybal l.swf">
<param name=quality value=high><param name="BGCOLOR" value="#FFFFFF">
<embed src="Top/Empirevolleyball. swf" width="725" height="210" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockw ave-flash" bgcolor="#FFFFFF"></embed>
</object></td>
</tr>
</table>
<table width="944" height="582" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#000000">
<td height="38" bgcolor="#FFFFFF"> </ td>
<td height="38"> </td>
<td colspan="3"> </td>
<td width="9" rowspan="9"> </td>
<td width="13" rowspan="9"> </td>
</tr>
<tr bgcolor="#000000">
<td height="28" bgcolor="#FFFFFF"> </ td>
<td height="28"> </td>
<td height="28" colspan="3"> </td>
</tr>
<tr bgcolor="#000000">
<td height="0" bgcolor="#FFFFFF"> </ td>
<td height="29"> </td>
<td width="223" height="29" bgcolor="#FFFFFF"><span class="style3"><%=(Records et1.Fields .Item("Pro dName").Va lue)%></sp an></td>
<td width="265" bgcolor="#FFFFFF"><span class="style5">Click Any Picture for more info </span></td>
<td width="182" bgcolor="#FFFFFF"><div align="center"><span class="style3"><%=(Records et1.Fields .Item("Pri ce").Value )%></span> </div></td >
</tr>
<tr bgcolor="#000000">
<td height="19" bgcolor="#FFFFFF"> </ td>
<td height="19"> </td>
<td height="19" colspan="3" bgcolor="#FFFFFF"><div align="center"> <a href="The_Empire_Store_Gea r.asp"><im g src="<%=(Recordset1.Fields .Item("Pic ture").Val ue)%></a>
<%
Repeat1__index=Repeat1__in dex+1
Repeat1__numRows=Repeat1__ numRows-1
Recordset1.MoveNext()
Wend
%>
<tr bgcolor="#000000">
<td height="19" bgcolor="#FFFFFF"> </ td>
<td height="19"> </td>
<td height="19" bgcolor="#FFFFFF"> </ td>
<td height="19" bgcolor="#FFFFFF"> </ td>
<td height="19" bgcolor="#FFFFFF"> </ td>
</tr>
<tr bgcolor="#000000">
<td height="41" bgcolor="#FFFFFF"> </ td>
<td height="41"> </td>
<td colspan="3" bgcolor="#FFFFFF"> </ td>
</tr>
<tr bgcolor="#000000">
<td height="82" bgcolor="#FFFFFF"> </ td>
<td height="82"> </td>
<td colspan="3" bgcolor="#FFFFFF"> </ td>
</tr>
<tr bgcolor="#000000">
<td width="233" height="63" bgcolor="#FFFFFF"><table width="233" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<td width="19" bgcolor="#000000"> </ td>
<td colspan="3"> </td>
</tr>
<tr bgcolor="#000000">
<td height="19" colspan="5" bgcolor="#FFFFFF"> </ td>
</tr>
</table>
<object classid="clsid:D27CDB6E-AE 6D-11cf-96 B8-4445535 40000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="517" height="274" style="position: absolute; top: 271px; left: 10px; z-index:1; visibility: hidden;" >
<param name="movie" value="Menu/empireleft_nav .swf" />
<param name="quality" value="high" />
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="transparent" />
<embed src="Menu/empireleft_nav.s wf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockw ave-flash" width="517" height="274" allowScriptAccess="always" wmode="transparent"></embe d>
</object>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<!--#include file="Connections/Empire.a
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB
Recordset1.ActiveConnectio
Recordset1.Source = "SELECT * FROM Store ORDER BY CatagoryID ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Empire Volleyball Club</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(p
document.MM_pgW=innerWidth
else if (innerWidth!=document.MM_p
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
body {
background-color: #000000;
}
.style3 {font-family: "Copperplate Gothic Bold"}
.style5 {font-family: "Copperplate Gothic Bold"; font-size: 14px; }
-->
</style></head>
<body>
<table width="850" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr bgcolor="#FFFFFF">
<td width="234" height="210"><img src="Top/EmpireShadow250x2
<td colspan="4"><object classid="clsid:D27CDB6E-AE
<param name="movie" value="Top/Empirevolleybal
<param name=quality value=high><param name="BGCOLOR" value="#FFFFFF">
<embed src="Top/Empirevolleyball.
</object></td>
</tr>
</table>
<table width="944" height="582" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#000000">
<td height="38" bgcolor="#FFFFFF"> </
<td height="38"> </td>
<td colspan="3"> </td>
<td width="9" rowspan="9"> </td>
<td width="13" rowspan="9"> </td>
</tr>
<tr bgcolor="#000000">
<td height="28" bgcolor="#FFFFFF"> </
<td height="28"> </td>
<td height="28" colspan="3"> </td>
</tr>
<tr bgcolor="#000000">
<td height="0" bgcolor="#FFFFFF"> </
<td height="29"> </td>
<td width="223" height="29" bgcolor="#FFFFFF"><span class="style3"><%=(Records
<td width="265" bgcolor="#FFFFFF"><span class="style5">Click Any Picture for more info </span></td>
<td width="182" bgcolor="#FFFFFF"><div align="center"><span class="style3"><%=(Records
</tr>
<tr bgcolor="#000000">
<td height="19" bgcolor="#FFFFFF"> </
<td height="19"> </td>
<td height="19" colspan="3" bgcolor="#FFFFFF"><div align="center"> <a href="The_Empire_Store_Gea
<%
Repeat1__index=Repeat1__in
Repeat1__numRows=Repeat1__
Recordset1.MoveNext()
Wend
%>
<tr bgcolor="#000000">
<td height="19" bgcolor="#FFFFFF"> </
<td height="19"> </td>
<td height="19" bgcolor="#FFFFFF"> </
<td height="19" bgcolor="#FFFFFF"> </
<td height="19" bgcolor="#FFFFFF"> </
</tr>
<tr bgcolor="#000000">
<td height="41" bgcolor="#FFFFFF"> </
<td height="41"> </td>
<td colspan="3" bgcolor="#FFFFFF"> </
</tr>
<tr bgcolor="#000000">
<td height="82" bgcolor="#FFFFFF"> </
<td height="82"> </td>
<td colspan="3" bgcolor="#FFFFFF"> </
</tr>
<tr bgcolor="#000000">
<td width="233" height="63" bgcolor="#FFFFFF"><table width="233" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<td width="19" bgcolor="#000000"> </
<td colspan="3"> </td>
</tr>
<tr bgcolor="#000000">
<td height="19" colspan="5" bgcolor="#FFFFFF"> </
</tr>
</table>
<object classid="clsid:D27CDB6E-AE
<param name="movie" value="Menu/empireleft_nav
<param name="quality" value="high" />
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="transparent" />
<embed src="Menu/empireleft_nav.s
</object>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
Hi Jesse.
Possible mea culpa coming. The code I posted is not correct (hangs head in shame):
<a href="The_Empire_Store_Gea r.asp"><im g src="<%=(Recordset1.Fields .Item("Pic ture").Val ue)%></a>
is missing some closing quotes. Try:
<a href="The_Empire_Store_Gea r.asp"><im g src="<%=(Recordset1.Fields .Item("Pic ture").Val ue)%>" ></a>
Also make sure the value stored in the field "Picture" points to the correct path and file name to the image.
Possible mea culpa coming. The code I posted is not correct (hangs head in shame):
<a href="The_Empire_Store_Gea
is missing some closing quotes. Try:
<a href="The_Empire_Store_Gea
Also make sure the value stored in the field "Picture" points to the correct path and file name to the image.
ASKER
That worked- sweet
while I have you here what if i had multiple pictures being accessed via repeating recordsets
In other words i have a few pictures being accessed and now I want to have each one go to a different url. I uped the points!
while I have you here what if i had multiple pictures being accessed via repeating recordsets
In other words i have a few pictures being accessed and now I want to have each one go to a different url. I uped the points!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
We may need to see the rest of the ASP code to troubleshoot it, but I see problems with the above.
<a href="The_Empire_Store_Gea
The img command is embedded into the <a> tag instead of being enclosed by it. Should be:
<a href="The_Empire_Store_Gea
Now, that should link the image to The_Empire_Store_Gear.asp page. If you want that page to do a lookup, you will need to feed it a variable. Without seeing the structure of the table, I don't know which variable to feed it...