Sauron
|
Posted: 12/22/2002, 4:29 AM |
|
Hi
I'm using ASP + templates, Access base and working on Bookstore example
(Verisign Tutorial).
Here is the problem: I added the item_quantity field in the items table. So
what I tried to do is update that field every time purchase is made. But I
keep getting error messages:
" You tried to execute a query that does not include the specified
expression 'item_quantity' as part of an aggregate function.
This is the Event Open code:
dim pnref
dim result
dim respmsg
pnref= getParam("pnref")
result = getParam("RESULT")
respmsg = getParam("RESPMSG")
if result = 0 then
cn.execute("insert into invoices (member_id, invoice_id) values (" &
Session("UserID") & ", '" & pnref & "')")
cn.execute("update items set items.item_quantity = sum (items.item_quantity
+ (orders.quantity)) where member_id = " & Session("UserID")&" and item_id=
items.item_id ")
cn.execute("insert into purchases (invoice_id, order_id, member_id, item_id,
quantity) select '" & pnref & "', order_id, member_id, item_id, quantity
from orders where member_id = " & Session("UserID"))
else
response.write "This transaction was not approved.<br> Please adjust your
payment details and try again."
end if
What am I doing wrong?
Thanks
Miron
|
|
|
|