PDA

View Full Version : Store Cart Details in Database


jon245706
04-08-2009, 09:22 AM
Is there any in depth documentation on the Store Cart Details in Database function ?

I am using it to update cart details which are already stored.

In the code it definitely does a check to see if they exist, and then decides to do an SQL update or an SQL insert.

I have set the order reference index to be No Duplicate. As I am expecting the extension to find the record and then update it.

However I can't see how or what parameters are need to get the extension to perform an SQL Update ?

-----------------------------------------------------------------------------------------------------------

This is the error generated:

INSERT into Orders (OrderReferenceID,OrderVipUserID,OrderTotalQuantit y,OrderStatus) values ('6',6,8,1)
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.

Ray Borduin
04-08-2009, 11:45 AM
Store cart details order id column cannot be set to no duplicate. Since one row per item in the cart is inserted, it must allow duplicates. It will delete ALL rows with that reference ID and re-insert all rows so it doesn't have to be unique.

jon245706
04-08-2009, 12:32 PM
Hi Ray

Excellent, thanks for the help. I'll try that.

The error is actually occurring on the Orders Summary table (where I have the ref index set to unique).

Would the same explanation apply ?

Ray Borduin
04-08-2009, 12:44 PM
Store cart summary should find and replace the row. Did you specify the unique column as the orderID column in the store cart summary table? That should work.

jon245706
04-09-2009, 05:58 AM
It worked.

I had set the order summary ref to unique as I thought it would help. I changed the Order Summary ref to Duplicates OK.

The Store ecart to Database code does update the details if the Order ref already exists.

Thank you