problem with syntax
hei guys,
this is the error i'm getting in my browser :
Data type mismatch in criteria expression.
.....
Line 364: SQL.ExecuteNonQuery()
& here's my code :
Dim mDelivery, mDiscount, mSubtotal, mTax, mTotal As Double
........
SQL.Parameters.Clear() ' Clear the parameters buffer else error
SQL.CommandText = "UPDATE Orders SET PromotionCode = @promocode, " & _
"Completed = TRUE, DateTimeCompleted = @TimeNow, Subtotal = @subtotal, " & _
"Total = @Total, Tax = @Tax, Delivery = @Delivery, Discount = @Discount " & _
"Where OrderID = @OrderIdentification"
SQL.Parameters.Add(New OleDb.OleDbParameter("Promocode", txtPromotionalCode.Text))
SQL.Parameters.Add("TimeNow", Now)
SQL.Parameters.Add("subtotal", mSubtotal)
SQL.Parameters.Add("Total", mTotal)
SQL.Parameters.Add("Tax", mTax)
SQL.Parameters.Add("Delivery", mDelivery)
SQL.Parameters.Add("Discount", mDiscount)
SQL.Parameters.Add("OrderIdentification", Session("OrderID"))
SQL.ExecuteNonQuery()
I'm kinda stumped trynna get this to work, so mabey someone could either point out any syntax errors or throw any hints my way as to whats going wrong.
Mabey i'm missing some single quotes ' ' around certain values (such as time), or my MS Access database needs number values to be rounded to 2 decimal places or in a currency format.....
any comments appreciated
thx,
mark
|