|Posted: 12/22/2002, 4:29 AM
I'm using ASP + templates, Access base and working on Bookstore example
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:
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=
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"))
response.write "This transaction was not approved.<br> Please adjust your
payment details and try again."
What am I doing wrong?