<% 'Last Modified:Nov-19-2002 'Developed by Antonio Beckles. option explicit Dim myConn 'Connection to Database Dim myRs 'Recordset Dim myRs1 'Recordset Dim myRs2 'Recordset Dim vDSN 'DataSource Name Dim strSQL 'SQL Query String Dim strSQLrecipes 'SQL Query String Dim strSQLPackages 'SQL Query String Dim totalRecs 'total number of records returned %> Product Details <% ' Create and open ADO connection Set myConn = Server.CreateObject("ADODB.Connection") myConn.Open "NativeTreasures" ' Create SQL Query strSQL = "SELECT * FROM Products WHERE product_status = 'Y' AND product_code = " & Request.QueryString("product_code") ' Create and open ADO recordset Set myRs = Server.CreateObject("ADODB.Recordset") myRs.CursorLocation = 3 ' adUseClient myRs.Open strSQL, myConn If myRs.EOF Then Response.Write "

There are no Records in This Table

" Else 'Get the total number of records totalRecs = myRs.RecordCount %>
 

<%Response.Write myRs.Fields("product_name")%>

<% If myRs.Fields("product_story") <> "blank" Then %> <%Response.Write myRs.Fields("product_story")%>

<% End If %> Description

<% If myRs.Fields("product_image_lrg") = "blank" Then %> <% Else %> " align="right" hspace="8"> <% End If %> <%Response.Write myRs.Fields("product_description")%>

<%Response.Write myRs.Fields("product_tip")%>

<% ' Create SQL Query to get related packages strSQLPackages = "SELECT * FROM Products, package_product, Packages WHERE Products.product_code = " & Request.QueryString("product_code") & "AND Products.product_code = package_product.product_code AND package_product.package_id = Packages.package_id" ' Create and open ADO recordset Set myRs1 = Server.CreateObject("ADODB.Recordset") myRs1.CursorLocation = 3 ' adUseClient myRs1.Open strSQLPackages, myConn If myRs1.EOF Then Response.Write "

There are no related Packages.

" Else Response.Write "If you don't find a product or combination that you like, please email your request to annemarie@native-treasures.com

Related Packages
"%> <% Do While (Not myRs1.EOF) %> <% myRs1.MoveNext Loop ' Close Recordset1 myRs1.Close Set myRs1 = Nothing End If %>
&product_code=<%=Request.QueryString("product_code")%>"><%Response.Write myRs1.Fields("package_name")%> US <%Response.Write FormatCurrency(myRs1.Fields("package_price"))%> " target="_blank">Add to cart


<% ' Create SQL Query to get related recipes strSQLrecipes = "SELECT * FROM Products, product_recipe, Recipes WHERE product_status = 'Y' AND product_code = " & Request.QueryString("product_code") & "AND Products.product_code = product_recipe.product AND product_recipe.recipe = Recipes.recipe_code" ' Create and open ADO recordset Set myRs2 = Server.CreateObject("ADODB.Recordset") myRs2.CursorLocation = 3 ' adUseClient myRs2.Open strSQLrecipes, myConn If myRs2.EOF Then Response.Write "

There are no related Recipes.

" Else Response.Write "Related Recipes
" Do While (Not myRs2.EOF) %> " title="Click for more details"><%Response.Write myRs2.Fields("recipe_name")%>
<% myRs2.MoveNext Loop ' Close Recordset2 myRs2.Close Set myRs2 = Nothing %> <% End If %>

   Back to Products

Copyright 2002 Native Treasures Inc.

<% End If %> <% ' Close Recordset myRs.Close Set myRs = Nothing ' Close Connection to Database myConn.Close Set myConn = Nothing %>