UNKNOWN
//**************************************
// Name: Build A Dynamic Interactive Price List From A Database
// Description:Builds an interactive product price calculator from a database. Uses Server-side VBScript and Client-side JavaScript.
// By: Ary
//
//
// Inputs:Product Type
Currency Used
//
// Returns:Products Selected
Overall Price (so that it can then accept credit card details, etc)
//
//Assumes:This code will not work straight away, it is mainly to explain haw it's done.
//
//Side Effects:None
//This code is copyrighted and has limited warranties.
//Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.1860/lngWId.2/qx/vb/scripts/ShowCode.htm
//for details.
//**************************************
<%@ Language=VBScript %>
<%
Response.Buffer=true
Response.Expires=Now()+1
Const adOpenKeySet = 1
Const adLockReadOnly = 1
strScriptName = Request.ServerVariables("SCRIPT_NAME")
Set rsAdd = Server.CreateObject("ADODB.Recordset")
Set rs = Server.CreateObject("ADODB.Recordset")
Set rsPP = Server.CreateObject("ADODB.Recordset")
// 'Get table to work on
Dim SoftTitle
Select Case Request.QueryString("ProdID")
Case "CHK": SoftTitle = "Socks"
Case "DBI": SoftTitle = "Trousers"
Case "NOT": SoftTitle = "Shirts"
Case "PRO": SoftTitle = "skirts"
Case "RET": SoftTitle = "dresses"
Case "TRK": SoftTitle = "shorts"
Case "TRS": SoftTitle = "t-shirts"
End Select
sSQL = "SELECT * FROM items WHERE type = '" & Request.QueryString("ProdID") & "'"
rs.open sSQL,db,adOpenKeySet,adLockReadOnly
' Get currency to use
dim PriceType
Dim PriceIcon
Select Case Request.QueryString("Currency")
Case "UK"
PriceType = "uk"
PriceIcon = "£"
Case "US"
PriceType = "us"
PriceIcon = "$"
Case "EU"
PriceType = "euro"
PriceIcon = "€"
end select
%>
Build Price Calculator From Database