Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Certain fields not displaying from SQL Server

Author  Topic 

scot
Starting Member

7 Posts

Posted - 2010-09-08 : 20:21:49
I'm not sure if this is the appropriate forum for this and I apologize if it's not and would appreciate any direction as to where I should post this. I am converting a small website from a MS Access database to SQL Server. I am very new to SQL Server and everything has been ok except for this one issue. The product detail page displays a large image and 2 thumbnails for 2 additional images. (link>>http://goodboyroy.com/product-detail.asp?id=109713471) When the thumbnails are clicked I use a javascript onclick function to change the style display to none/block for the image toggles. Everything works perfect in MS Access but for some reason it will not recognize (treats it as it were an empty field) the data for the thumbnail image name fields. The code lists the 3 large images with only one display set to block and then I list the 3 thumbnail images with the other images. I created a test page and played around and discovered that the first 3 images show up and the last 3 don't. If I move the thumbnail images above the large then the thumbs show and the large don't. Has anyone seen this before or have any idea.

scot

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-09-09 : 00:26:01
I'd love to see the ASP for this. It is not a SQL issue -- unless you're failing to pull the image paths from the db.

I don't think this is a SQL issue, but go ahead and post the asp code and let's have a look-see.

By the way, you should be pre-loading your rollover images in the left hand nav section. There is a noticeable delay in mousing over and the image flipping. See here if you don't know what I mean: http://www.webreference.com/dhtml/column1/preload.html

(i know someone who used to write for that site in a past life )
Go to Top of Page

scot
Starting Member

7 Posts

Posted - 2010-09-09 : 07:43:17
Thanks for the advice on the image preload. I'll get that in today. Below is the code for that page. I also noticed one other thing. When I switch the connection to the SQL Server the LightBox (JQuery)photo gallery (button next to thumbnail images) pulls the first image but the next/previous arrows do not show up. This gallery is pulling from the database as well. I appreciate your time with this. Thanks,

----------------------------------
<!--#include file="template-top.asp"-->
<style type="text/css">
h3 {color:#2059a0;font-weight:bold;border-bottom:2px solid #2059a0;margin-bottom:8px;font-size:14px;width:250px;}
</style>

<%
Dim prod,shirtname
prod = Request.Querystring("id")

Set rS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM product_styles WHERE id="&prod
rS.Open strSQL, adoCon
shirtname = rS("name")
%>

<form method="POST" action="https://www.asecurecart.net/server/cart.aspx/Goodboyroy">
<h1>GoodBoyRoy T-Shirts</h1>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="detail-left" width="305" valign="top">
<h2><%=rS("name")%></h2>
<p style="font-weight:normal;color:#000000;font-size:16px"><strong>Price:</strong>  $<%=rS("price")%></p>
<div style="margin-top:10px;margin-bottom:20px">
<table>
<tr>
<td>
<h3>Available Colors <br><span style="color:#999999;font-size:12px;font-style:italic">(Select color to view available sizes)</span></h3>

<!-----------------------------BEGIN COLOR OPTION DISPLAY------------------------------------->
<table cellpadding="0" cellspacing="0">
<tr>
<%
Dim rS2,strSQL2,color,ccount
ccount = 0
Set rS2 = Server.CreateObject("ADODB.Recordset")
strSQL2 = "SELECT DISTINCT color, color_image FROM product_options WHERE style_id="&prod
rS2.Open strSQL2, adoCon
Do While Not rS2.EOF
color = rS2("color")
%>
<td width="50%"><div class="color" onMouseOver="this.style.border='2px solid #d2e3f6'" onMouseOut="this.style.border='2px solid #EEEEEE'">
<a href="product-detail.asp?id=<%=prod%>&color=<%=color%>"><img src="website-manager/images/products/colors/<%=rS2("color_image")%>" style="border:none"></a>
</div></td>
<%
ccount = ccount + 1
If ccount = 2 Then
%>
</tr><tr>
<%
End If
rS2.MoveNext
Loop
rS2.Close
Set rS2 = Nothing
%>
</tr>
</table>
</td>
</tr>
</table>
<!---------------------------END COLOR OPTION DISPLAY------------------------------->
</div>
<div style="margin-bottom:20px">
<%
color = Request.Querystring("color")
If color = "" Then
%>
<h3 style="color:#cccccc;border-bottom:2px solid #cccccc">Available Sizes</h3>
<table width="250">
<tr>
<td style="color:#cccccc">-Youth Sizes-</td><td style="color:#cccccc">-Adult Sizes-</td>
</tr>
</table>
<%Else%>


<h3>Available Sizes in <%=color%></h3>
<table width="250">
<tr>
<!----------------------------BEGIN YOUTH SIZES-------------------------------------->
<td width="50%" valign="top">
<strong>-Youth Sizes-</strong><br>
<%
Dim rS3,strSQL3
ccount = 0
Set rS3 = Server.CreateObject("ADODB.Recordset")
strSQL3 = "SELECT size, size_type FROM product_options WHERE style_id="&prod&" AND color='"&color&"' AND size_type = 'youth' ORDER BY size_sort ASC"
rS3.Open strSQL3, adoCon
Do While Not rS3.EOF
%>
<input type="radio" name="size" value="<%=rS3("size")%>-<%=rS3("size_type")%>" onClick="formshowhide('add_to_cart')">  <%=rS3("size")%><br>
<%
ccount = ccount + 1
rS3.MoveNext
Loop
If ccount = 0 Then
%>
<p style="font-weight:bold;color:#FF0000">None Available</p>
<%
End If
rS3.Close
Set rS3 = Nothing
%>

</td>
<!----------------------------END YOUTH SIZES-------------------------------------->
<!----------------------------BEGIN ADULT SIZES-------------------------------------->
<td width="50%" valign="top">
<strong>-Adult Sizes-</strong><br>
<%
Dim rS4,strSQL4,size
ccount = 0
Set rS4 = Server.CreateObject("ADODB.Recordset")
strSQL4 = "SELECT size, size_type FROM product_options WHERE style_id="&prod&" AND color='"&color&"' AND size_type = 'adult' ORDER BY size_sort ASC"
rS4.Open strSQL4, adoCon
Do While Not rS4.EOF
size = rS4("size")
%>
<input type="radio" name="size" value="<%=rS4("size")%>-<%=rS4("size_type")%>" onClick="formshowhide('add_to_cart')">  <%=rS4("size")%><br>
<%
ccount = ccount + 1
rS4.MoveNext
Loop
If ccount = 0 Then
%>
<p style="font-weight:bold;color:#FF0000">None Available</p>
<%
End If
rS4.Close
Set rS4 = Nothing
%>
</td>
<!------------------------------END ADULT SIZES-------------------------------------->
</tr>
</table>
<%End If%>
</div>
<div>
<table>
<tr>
<td valign="middle" style="color:#000000;font-size:14px;font-weight:bold">Qty <input type="text" name="quantity" size="1" maxlength="3" value="1"></td>
<input type="hidden" name="color" value="<%=color%>">
<input type="hidden" name="ID" value="<%=rS("id")%>">
<input type="hidden" name="Describe" value="<%=rS("name")%>">
<input type="hidden" name="Price" value="<%=rS("price")%>">
<input type="hidden" name="Multi" value="N">
<td style="padding-left:10px">
<div id="disabled"><img src="images/add_to_cart_disabled.jpg" alt="You must select a size before adding to cart."></div>
<div id="enabled" style="display:none"><input type="image" src="images/add_to_cart.jpg" value="submit"></div>
</td>
</tr>
</table>
</div>
<div style="margin-top:25px"><a href="characters.asp"><img src="images/meet_characters.jpg" style="border:none"></a></div>
<p class="gallery" style="width:275px;font-size:11px;font-family:arial;margin-top:25px">If you don't see the size or color you are looking for and would like to request a specific shirt or for bulk, custom or wholesale orders please contact <a href="mailto:sales@goodboyroy.com">sales@goodboyroy.com</a> or <a href="request-product.asp?product=<%=shirtname%>&iframe=true&width=50%&height=70%" rel="prettyPhoto[request]" style="color:#CC5500;text-decoration:underline">click here</a> to fill out our Special Request form and a GoodBoyRoy.com representitive
will contact you.</p>
</td>
<td valign="top" style="padding-left:7px">
<div id="imagebox">
<!--------------BEGIN LARGE IMAGES------------------>
<div id="front_lg" style="display:block;margin-bottom:5px;width:305px;height:388px" class="pancontainer" data-orient="center" data-canzoom="yes">
<img src="website-manager/images/products/<%=rS("image_large")%>" style="width:305px;height:388px;margin-bottom:0px">
</div>

<div id="back_lg" style="display:none;width:305px;height:388px;padding-bottom:0px">
<img src="website-manager/images/products/<%=rS("image_back_large")%>" style="width:303px;height:388px;margin-bottom:0px;border:1px solid black">
</div>

<div id="alt_lg" style="display:none;width:305px;height:388px;padding-bottom:0px">
<img src="website-manager/images/products/<%=rS("image_alt_large")%>" style="width:303px;height:388px;margin-bottom:0px;border:1px solid black">
</div>

<table width="305" height="75" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="180" height="75" align="center">
<table width="180" height="75" cellpadding="0" cellspacing="0" border="0">
<tr>
<!-----------------BEGIN THE THUMBNAIL IMAGES------------->
<td width="0">
<div id="front_sm" style="display:none">
<a href="javascript:void(0)" onclick = "document.getElementById('back_lg').style.display='none';document.getElementById('front_lg').style.display='block';document.getElementById('back_sm').style.display='block';document.getElementById('front_sm').style.display='none';document.getElementById('alt_lg').style.display='none';document.getElementById('alt_sm').style.display='block';"><img src="website-manager/images/products/<%=rS("image_thumb")%>" class="magnify" data-magnifyby="1.5" width="75" height="75" style="border:none"></a>
</div>
</td>
<td width="0">
<div id="back_sm" style="display:block">
<a href="javascript:void(0)" onclick = "document.getElementById('back_lg').style.display='block';document.getElementById('front_lg').style.display='none';document.getElementById('back_sm').style.display='none';document.getElementById('front_sm').style.display='block';document.getElementById('alt_lg').style.display='none';document.getElementById('alt_sm').style.display='block';"><img src="website-manager/images/products/<%=rS("image_back_thumb")%>" width="75" height="75" style="border:none"></a>
</div>
</td>
<td width="0">
<div id="alt_sm" style="display:block">
<a href="javascript:void(0)" onclick = "document.getElementById('back_lg').style.display='none';document.getElementById('front_lg').style.display='none';document.getElementById('back_sm').style.display='block';document.getElementById('front_sm').style.display='block';document.getElementById('alt_lg').style.display='block';document.getElementById('alt_sm').style.display='none';"><img src="website-manager/images/products/<%=rS("image_alt_thumb")%>" width="75" height="75" style="border:none"></a>
</div>

</td>
</tr>
</table>
</td>


<td width="125" class="gallery">

<%
rS.Close
Set rS = Nothing
%>
<div style="float:right"><a href="website-manager/images/photo-gallery/gallery_landing_image.jpg" rel="prettyPhoto[product]"><img src="images/gallery-btn.jpg" style="border:none"></a></div>
<div style="clear:both"></div>

<%
Dim rS5,strSQL5
Set rS5 = Server.CreateObject("ADODB.Recordset")
strSQL5 = "SELECT * FROM photo_gallery"
rS5.Open strSQL5, adoCon

Do While Not rS5.EOF
%>
<a href="website-manager/images/photo-gallery/<%=rS5("image")%>" rel="prettyPhoto[product]" alt="<%=rS5("caption")%>"></a>
<%
rS5.MoveNext
Loop
rS5.Close
Set rS5 = Nothing

%>

</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</form>


<!--#include file="template-bottom.asp"-->

scot
Go to Top of Page

scot
Starting Member

7 Posts

Posted - 2010-09-10 : 08:45:27
All data on that page after the large images are listed is not recognized. The gallery button pulls up a lightbox gallery. The first image is hardcoded but the additional images are being looped out of a gallery table in the database.

scot
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-09-10 : 14:02:45
looks like u fixed it
Go to Top of Page

scot
Starting Member

7 Posts

Posted - 2010-09-10 : 16:39:11
no it's not fixed. I just changed the connection string back to the MS Access database. My issue with the MS Access database is that I've been getting an "Unspecified Error" every now and then that lasts for about an hour or so and was told that it's probably a database locking issue that happens with MS Access and I can't figure out how to get that corrected so I'm trying to move over to a SQL Server db (which i probably should anyway).

scot
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-09-10 : 16:46:45
where do you define this?

<%=rS("image_thumb")%>
Go to Top of Page

scot
Starting Member

7 Posts

Posted - 2010-09-16 : 08:10:59
At the top around line 11.
Set rS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM product_styles WHERE id="&prod
rS.Open strSQL, adoCon

scot
Go to Top of Page
   

- Advertisement -