johnyfav
Oct 19th 2005, 4:41 am
I have been looking at this code for the last 45 mins and I really can't see what I have done wrong. Can someone please put me out of my misery?
<%
Dim johnsectstuff
Dim thePrioductURL
Set liveProducts = Server.CreateObject("ADODB.Recordset")
liveProducts.ActiveConnection = MM_TBW2003_STRING
liveProducts.Source = "SELECT dbo.productsInSubSections.subSectionID AS subsectionid, dbo.products.id AS productid, dbo.products.introText AS introtext, dbo.products.productName AS productname, dbo.products.manufacturer AS manufacturerid, dbo.manufacturer.manufacturerName AS manufacturername, dbo.productOptions.productOptionName AS productoptionname, dbo.productOptions.productOptionDescription AS productdescription, dbo.productOptions.productCode AS productcode, dbo.productOptions.shopRRP, dbo.productOptions.shopPromotionalPrice, dbo.productOptions.shopOfferPrice, dbo.productOptions.includeInShop, dbo.productOptions.type, dbo.productOptions.id AS prodoptionid, dbo.subSections.subSectionName AS subsectionname, dbo.sections.id AS sectionid, dbo.sections.sectionName AS sectionname, dbo.productOptions.stockStatus FROM dbo.products INNER JOIN dbo.productOptions ON dbo.products.id = dbo.productOptions.productID INNER JOIN dbo.manufacturer ON dbo.products.manufacturer = dbo.manufacturer.id INNER JOIN dbo.productsInSubSections ON dbo.products.id = dbo.productsInSubSections.productID INNER JOIN dbo.subSections ON dbo.productsInSubSections.subSectionID = dbo.subSections.id INNER JOIN dbo.sections ON dbo.subSections.relatedSection = dbo.sections.id WHERE (dbo.products.active = 1) AND (dbo.productOptions.type = 1) AND (dbo.productOptions.includeInShop = 1)"
liveProducts.CursorType = 0
liveProducts.CursorLocation = 2
liveProducts.LockType = 1
liveProducts.Open()
theURLSectionName = replace(liveProducts("sectionname"), "/ ", "")
%>
<%
while not liveProducts.eof
johnsectstuff = liveProducts("sectionid")
if johnsectstuff = 1 or 12 then
response.write "Computer Accessories | Scanner"
else if johnsectstuff = 4 or 13 then
response.write "Printers | Label"
else if johnsectstuff = 3 then
response.write "PDA | Product"
else if johnsectstuff = 7 then
response.write "Software | Windows Software"
else if johnsectstuff = 11 then
response.write "Computer Accessories | Printer Accessory"
else
response.write "Missing"
end if 'johnsectstuff
%>
|
<% 'Manufacturer Name %>
<% response.write liveProducts("manufacturername") %>
|
<% 'Product Name %>
<% response.write liveProducts("productname") %> - <% response.write liveProducts("productoptionname") %>
| | | | | | |
<% ' MPN %>
<% response.write liveProducts("productcode") %>
|
<% response.write liveProducts("prodoptionid") %>
|
<% response.Write liveProducts("introText") %>
| |
http://www.thebarcodewarehouse.co.uk/images/products/<% response.write liveProducts("productid") %>.jpg |
http://www.thebarcodewarehouse.co.uk/<%= server.URLEncode(lcase(theURLsectionName)) %>/<%= server.URLEncode(lcase(liveProducts("manufacturername"))) %>/<%= server.URLEncode(lcase(liveProducts("productname"))) %>/<%= liveProducts("productid") %>/<%= liveProducts("subSectionid") %>/0 |
<%
Dim froogleprice
if liveProducts("shopOfferPrice") > 0 then
froogleprice=liveProducts("shopOfferPrice")
else
if liveProducts("shopPromotionalPrice") > 0 then
froogleprice=liveProducts("shopPromotionalPrice")
else
froogleprice=liveProducts("shopRRP")
end if
end if
froogleprice=formatNumber((froogleprice * 1.175), 2)
response.write froogleprice
%>
|
<% if froogleprice > 100 then %>
0 |
<% else %>
10 |
<% end if %>
<% if liveProducts("stockStatus") = 1 then %>
Next Day | In Stock |
<% else if liveProducts("stockStatus") = 12 then %>
Usually 2-3 days | Available on Order |
<% else if liveProducts("stockStatus") = 13 then %>
Usually 3-5 days | Available on Order |
<% else if liveProducts("stockStatus") = 14 then %>
Usually 5-7 days |Available on Order |
<% else if liveProducts("stockStatus") = 15 then %>
Usually 7-10 days | Available on Order |
<% else if liveProducts("stockStatus") = 16 then %>
Usually 10-14 days | Available on Order |
<% else if liveProducts("stockStatus") = 17 then %>
Usually 2-3 weeks | Available on Order |
<% else if liveProducts("stockStatus") = 18 then %>
Usually 3-4 weeks | Available on Order |
<% else if liveProducts("stockStatus") = 19 then %>
| Pre-Order |
<% else if liveProducts("stockStatus") = 20 then %>
| Check Site |
<% End if %>
<% response.write " New | <br> " %>
<%
liveProducts.movenext
Wend
liveProducts.Close()
set liveProducts = nothing
%>
Many many thanks in advance.
<%
Dim johnsectstuff
Dim thePrioductURL
Set liveProducts = Server.CreateObject("ADODB.Recordset")
liveProducts.ActiveConnection = MM_TBW2003_STRING
liveProducts.Source = "SELECT dbo.productsInSubSections.subSectionID AS subsectionid, dbo.products.id AS productid, dbo.products.introText AS introtext, dbo.products.productName AS productname, dbo.products.manufacturer AS manufacturerid, dbo.manufacturer.manufacturerName AS manufacturername, dbo.productOptions.productOptionName AS productoptionname, dbo.productOptions.productOptionDescription AS productdescription, dbo.productOptions.productCode AS productcode, dbo.productOptions.shopRRP, dbo.productOptions.shopPromotionalPrice, dbo.productOptions.shopOfferPrice, dbo.productOptions.includeInShop, dbo.productOptions.type, dbo.productOptions.id AS prodoptionid, dbo.subSections.subSectionName AS subsectionname, dbo.sections.id AS sectionid, dbo.sections.sectionName AS sectionname, dbo.productOptions.stockStatus FROM dbo.products INNER JOIN dbo.productOptions ON dbo.products.id = dbo.productOptions.productID INNER JOIN dbo.manufacturer ON dbo.products.manufacturer = dbo.manufacturer.id INNER JOIN dbo.productsInSubSections ON dbo.products.id = dbo.productsInSubSections.productID INNER JOIN dbo.subSections ON dbo.productsInSubSections.subSectionID = dbo.subSections.id INNER JOIN dbo.sections ON dbo.subSections.relatedSection = dbo.sections.id WHERE (dbo.products.active = 1) AND (dbo.productOptions.type = 1) AND (dbo.productOptions.includeInShop = 1)"
liveProducts.CursorType = 0
liveProducts.CursorLocation = 2
liveProducts.LockType = 1
liveProducts.Open()
theURLSectionName = replace(liveProducts("sectionname"), "/ ", "")
%>
<%
while not liveProducts.eof
johnsectstuff = liveProducts("sectionid")
if johnsectstuff = 1 or 12 then
response.write "Computer Accessories | Scanner"
else if johnsectstuff = 4 or 13 then
response.write "Printers | Label"
else if johnsectstuff = 3 then
response.write "PDA | Product"
else if johnsectstuff = 7 then
response.write "Software | Windows Software"
else if johnsectstuff = 11 then
response.write "Computer Accessories | Printer Accessory"
else
response.write "Missing"
end if 'johnsectstuff
%>
|
<% 'Manufacturer Name %>
<% response.write liveProducts("manufacturername") %>
|
<% 'Product Name %>
<% response.write liveProducts("productname") %> - <% response.write liveProducts("productoptionname") %>
| | | | | | |
<% ' MPN %>
<% response.write liveProducts("productcode") %>
|
<% response.write liveProducts("prodoptionid") %>
|
<% response.Write liveProducts("introText") %>
| |
http://www.thebarcodewarehouse.co.uk/images/products/<% response.write liveProducts("productid") %>.jpg |
http://www.thebarcodewarehouse.co.uk/<%= server.URLEncode(lcase(theURLsectionName)) %>/<%= server.URLEncode(lcase(liveProducts("manufacturername"))) %>/<%= server.URLEncode(lcase(liveProducts("productname"))) %>/<%= liveProducts("productid") %>/<%= liveProducts("subSectionid") %>/0 |
<%
Dim froogleprice
if liveProducts("shopOfferPrice") > 0 then
froogleprice=liveProducts("shopOfferPrice")
else
if liveProducts("shopPromotionalPrice") > 0 then
froogleprice=liveProducts("shopPromotionalPrice")
else
froogleprice=liveProducts("shopRRP")
end if
end if
froogleprice=formatNumber((froogleprice * 1.175), 2)
response.write froogleprice
%>
|
<% if froogleprice > 100 then %>
0 |
<% else %>
10 |
<% end if %>
<% if liveProducts("stockStatus") = 1 then %>
Next Day | In Stock |
<% else if liveProducts("stockStatus") = 12 then %>
Usually 2-3 days | Available on Order |
<% else if liveProducts("stockStatus") = 13 then %>
Usually 3-5 days | Available on Order |
<% else if liveProducts("stockStatus") = 14 then %>
Usually 5-7 days |Available on Order |
<% else if liveProducts("stockStatus") = 15 then %>
Usually 7-10 days | Available on Order |
<% else if liveProducts("stockStatus") = 16 then %>
Usually 10-14 days | Available on Order |
<% else if liveProducts("stockStatus") = 17 then %>
Usually 2-3 weeks | Available on Order |
<% else if liveProducts("stockStatus") = 18 then %>
Usually 3-4 weeks | Available on Order |
<% else if liveProducts("stockStatus") = 19 then %>
| Pre-Order |
<% else if liveProducts("stockStatus") = 20 then %>
| Check Site |
<% End if %>
<% response.write " New | <br> " %>
<%
liveProducts.movenext
Wend
liveProducts.Close()
set liveProducts = nothing
%>
Many many thanks in advance.