<%@LANGUAGE="VBSCRIPT"%> <% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' HTTP="false" ' Catalog="" ' Schema="" MM_dsPets_STRING = "dsn=dsPets;" %> <% set rsProductline = Server.CreateObject("ADODB.Recordset") rsProductline.ActiveConnection = MM_dsPets_STRING rsProductline.Source = "SELECT Productline_Name FROM tblProductline" rsProductline.CursorType = 0 rsProductline.CursorLocation = 2 rsProductline.LockType = 3 rsProductline.Open() rsProductline_numRows = 0 %> <% Dim rsProductList__MMColParam rsProductList__MMColParam = "1" if (Request.QueryString("Productline_ID") <> "") then rsProductList__MMColParam = Request.QueryString("Productline_ID") %> <% set rsProductList = Server.CreateObject("ADODB.Recordset") rsProductList.ActiveConnection = MM_dsPets_STRING rsProductList.Source = "SELECT * FROM tblProduct WHERE Productline_ID = " + Replace(rsProductList__MMColParam, "'", "''") + " ORDER BY Product_Name ASC" rsProductList.CursorType = 0 rsProductList.CursorLocation = 2 rsProductList.LockType = 3 rsProductList.Open() rsProductList_numRows = 0 %> <% Dim rsProduct_line__MMColParam rsProduct_line__MMColParam = "1" if (Request.QueryString("Category_ID") <> "") then rsProduct_line__MMColParam = Request.QueryString("Category_ID") %> <% set rsProduct_line = Server.CreateObject("ADODB.Recordset") rsProduct_line.ActiveConnection = MM_dsPets_STRING rsProduct_line.Source = "SELECT * FROM tblProductline WHERE Category_ID = " + Replace(rsProduct_line__MMColParam, "'", "''") + "" rsProduct_line.CursorType = 0 rsProduct_line.CursorLocation = 2 rsProduct_line.LockType = 3 rsProduct_line.Open() rsProduct_line_numRows = 0 %> <% Dim rsCategories__MMColParam rsCategories__MMColParam = "1" if (Request.QueryString("Category_ID") <> "") then rsCategories__MMColParam = Request.QueryString("Category_ID") %> <% set rsCategories = Server.CreateObject("ADODB.Recordset") rsCategories.ActiveConnection = MM_dsPets_STRING rsCategories.Source = "SELECT * FROM tblCategory WHERE Category_ID = " + Replace(rsCategories__MMColParam, "'", "''") + "" rsCategories.CursorType = 0 rsCategories.CursorLocation = 2 rsCategories.LockType = 3 rsCategories.Open() rsCategories_numRows = 0 %> <% Dim Repeat1__numRows Repeat1__numRows = -1 Dim Repeat1__index Repeat1__index = 0 rsProductList_numRows = rsProductList_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables ' set the record count rsProductList_total = rsProductList.RecordCount ' set the number of rows displayed on this page If (rsProductList_numRows < 0) Then rsProductList_numRows = rsProductList_total Elseif (rsProductList_numRows = 0) Then rsProductList_numRows = 1 End If ' set the first and last displayed record rsProductList_first = 1 rsProductList_last = rsProductList_first + rsProductList_numRows - 1 ' if we have the correct record count, check the other stats If (rsProductList_total <> -1) Then If (rsProductList_first > rsProductList_total) Then rsProductList_first = rsProductList_total If (rsProductList_last > rsProductList_total) Then rsProductList_last = rsProductList_total If (rsProductList_numRows > rsProductList_total) Then rsProductList_numRows = rsProductList_total End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (rsProductList_total = -1) Then ' count the total records by iterating through the recordset rsProductList_total=0 While (Not rsProductList.EOF) rsProductList_total = rsProductList_total + 1 rsProductList.MoveNext Wend ' reset the cursor to the beginning If (rsProductList.CursorType > 0) Then rsProductList.MoveFirst Else rsProductList.Requery End If ' set the number of rows displayed on this page If (rsProductList_numRows < 0 Or rsProductList_numRows > rsProductList_total) Then rsProductList_numRows = rsProductList_total End If ' set the first and last displayed record rsProductList_first = 1 rsProductList_last = rsProductList_first + rsProductList_numRows - 1 If (rsProductList_first > rsProductList_total) Then rsProductList_first = rsProductList_total If (rsProductList_last > rsProductList_total) Then rsProductList_last = rsProductList_total End If %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each Item In Request.QueryString NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item)) End If Next ' add the Form variables to the MM_keepForm string For Each Item In Request.Form NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> JOLLY ANTIQUES

 
<% count = 0 while not( rsProductList.eof ) if ( ( count mod 3 ) = 0 ) then ''' Change The Number after mod to the number of columns you want count1 = 0 if (count1 = 0 and count > 0) then %> <% end if %> <% else %> <% end if rsProductList.MoveNext count = count + 1 count1 = count1 + 1 wend count1=3-count1 if count1<3 and Count1>0 then for i=1 to count1%> <%next%> <%else%> <% end if %>
" target="_blank">/<%=(rsProductList.Fields.Item("Thumbnail").Value)%>" border="0"> ">

<%=(rsProductList.Fields.Item("Product_Name").Value)%>

" target="_blank">more detail
" target="_blank">/<%=(rsProductList.Fields.Item("Thumbnail").Value)%>" border="0"> ">

<%=(rsProductList.Fields.Item("Product_Name").Value)%>

" target="_blank">more detail
 

 

<% rsProductline.Close() %> <% rsProductList.Close() %> <% rsProduct_line.Close() %> <% rsCategories.Close() %>