/ Forside / Teknologi / Udvikling / ASP / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
ASP
#NavnPoint
smorch 9259
Harlekin 1866
molokyle 1040
Steffanst.. 758
gandalf 657
smilly 564
gibson 560
cumano 530
MouseKeep.. 480
10  Random 410
please help
Fra : Vivian


Dato : 01-06-02 00:36

Microsoft JET Database Engine (0x80040E14)
Syntaxisfout (operator ontbreekt) in query-expressie products.productID =
itemsOrdered.productID and itemsOrdered.orderID = 17and
itemsOrdered.productName = and itemsOrdered.productPrice =.
/mcartpal/reviewOrder.asp, line 105

Code:

<%@ Language=VBScript %>
<% pageTitle = "Review Order" %>
<!--#include file="adovbs.inc"-->
<!--#include file="db.asp"-->

<%
'******************************************************
'Copyright©2000-2001 MetaLinks.com @ http://metalinks.com
'******************************************************

%>
<html>
<head>
<meta name="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title><%= pageTitle %></title>
<script LANGUAGE="JavaScript"><!--

function AbortEntry(sMsg, eSrc)
{
window.alert(sMsg);
// set focus and highlight to the offending error
eSrc.focus();
//eSrc.select();
}

function HandleKeyUp(eSrc)
{
// make sure the input is a numeric value
var val = parseInt(eSrc.value);
if (isNaN(val))
{
return AbortEntry("Must be a number.", eSrc);
}

// make sure the value is not negative
if (val < 0)
{
return AbortEntry("Number cannot be less than zero.", eSrc);
}
}

//-->
</script>
<style type="text/css">
<!--
a:link { color: #808080 }
a:visited { color: #808080 }
a:hover { color: #6699cc }
-->
</style>
</head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0"
marginheight="0" text="#808080">
<basefont face="Verdana" size="2">
<!-- #include file="header.asp" -->
<!-- #include file="menubar.asp" -->
<hr color="#cccccc" size="1" noshade>
<table border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0"
width="625">
<tr>
<td width="128" valign="top" align="center">
<table border="0" cellspacing="4" cellpadding="4" width="125">
<tr>
<td width="128" bgcolor="#FFFFFF">
<!-- #include file="left.asp" -->
</td>
</tr>
</table>
<td width="1" bgcolor="#000000"><img src="images/spacer.gif" width="1"
height="1" alt border="0"></td>
<td align="left" valign="top"><table border="0" cellspacing="4"
cellpadding="4"><tr><td>
<%
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConString

if cstr(Session("orderID")) = "" then
Response.Write "<div align='center'>"
Response.Write "<p><font face='Verdana' size='4'><b>"
Response.Write "U heeft nog niets besteld." & "<br>"
Response.Write "Indien u eerder produkten in uw wagentje zette, "
Response.Write "heeft uw sessie een time-out.<br><br>"
Response.Write "<a href='default.asp'>Verder winkelen</a>"
Response.Write "<b></font></p>"
Response.Write "</div>"
else
intOrderID = cstr(Session("orderID"))

sqlText = "select products.productID, productName, " _
& "productPrice, quantity from products, " _
& "itemsOrdered where " _
& "products.productID = itemsOrdered.productID "_
& "and itemsOrdered.orderID = " & intOrderID _
& "and itemsOrdered.productName = " & strprodName _
& "and itemsOrdered.productPrice = " & intprodPrice
%>
<p><font face="Verdana" size="4"><strong>Review Your
Order</strong></font></p>
<p><font face="Verdana" size="2">Please review your order to be certain it
is correct.
To remove an item, set the quantity to zero and press the Update
Order button.</font></p>
<form action="checkout1.asp" method="post" id="form1" name="form1">
<table border="1" cellpadding="3" cellspacing="3" width="100%">
<tr bgcolor="#6699cc">
<td width="15%" align="left" valign="center" nowrap><font
color="#ffffff" face="Verdana" size="2" style="BACKGROUND-COLOR:
#6699cc"><strong>Quantity<strong></font></strong></strong></td>
<td width="44%" align="left" valign="center" nowrap><font
color="#ffffff" face="Verdana" size="2" style="BACKGROUND-COLOR:
#6699cc"><strong>Product Name<strong></font></strong></strong></td>
<td width="16%" align="left" valign="center"><font
color="#ffffff" face="Verdana" size="2" style="BACKGROUND-COLOR:
#6699cc"><strong>Unit Price<strong></font></strong></strong></td>
<td width="25%" align="right" valign="center" nowrap><font
color="#ffffff" face="Verdana" size="2" style="BACKGROUND-COLOR:
#6699cc"><strong>Extended Price<strong></font></strong></strong></td>
</tr>
<%
set rsReview = Conn.Execute(sqlText)
<-----------------------------------------this is the line
while not rsReview.EOF
intProdID = rsReview("productID")
strProdName = rsReview("productName")
ProdPrice = rsReview("productPrice")
intQuant = rsReview("quantity")
intTotal = intTotal + (intQuant * intProdPrice)
%>
<tr>
<td width="15%" valign="center" align="left"><font
face="Verdana" size="2">
<input name="quant<%= intProdID %>" size="6" value="
<%=intQuant%>" onSubmit="HandleKeyUp(this)">
</font></td>
<td width="44%" align="left"><font face="Verdana"
size="2">&nbsp;<%= strProdName %>
</font></td>
<td width="16%" align="right"><font face="Verdana" size="2">
$<%= formatNumber(intProdPrice, 2) %>
</font></td>
<td width="25%" align="right"><font face="Verdana" size="2">
$<%= formatNumber((intQuant * intProdPrice), 2) %>
</font></td>
</tr>
<%
rsReview.MoveNext
wend

rsReview.Close
set rsReview = Nothing
%>
<tr>
<td valign="center" align="left"><font face="Verdana"
size="2"><strong>Total:<strong></font></strong></strong></td>
<td colspan="3" align="right" valign="center"><font
face="Verdana" size="2"><strong>
$<%= formatNumber(intTotal,2) %>
<strong></font></strong></strong></td>
</tr>
</table>
<p><input type="submit" name="control" value="Update Order">
<input type="submit" name="control" value="Go To Check-Out"></p>
</form>
<form action="default.asp" method="post" id="formx" name="formx">
<input type="submit" name="buttonX" value="Continue Shopping">
</form>
<%
end if

Conn.Close
set Conn = Nothing
%>
</td>
</tr>
</table>

</td>
</tr>
</table>
<hr color="#cccccc" size="1" noshade>

<!--#include file="footer.asp"-->
</body>
</html>









 
 
Jakob Andersen (01-06-2002)
Kommentar
Fra : Jakob Andersen


Dato : 01-06-02 09:45

"Vivian" <vivian.eersels@wanadoo.be> wrote in message
news:ENTJ8.5389$ud.515@afrodite.telenet-ops.be...
> itemsOrdered.productID and itemsOrdered.orderID = 17and

^^
Du mangler et mellemrum i ovenstående.

--
Jakob Andersen



Søg
Reklame
Statistik
Spørgsmål : 177559
Tips : 31968
Nyheder : 719565
Indlæg : 6408938
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste