Jump to content
ducky77ar

ODBC to cubecart

Recommended Posts

Hello,

I'm using an ODBC MySQL connector to get data from cubecart to a front end Access Database.

I added 2 custom fields in the order_summary table, i noticed that when i try to edit them I get a write conflict error.  The research I did on this error concludes I need to add a timestamp field in order_summary for Access to work correctly.

Would adding a timestamp field on that table affect any of the shopping cart functionality?

Thank you!

Share this post


Link to post
Share on other sites

Acces.... *shudder*... 

the error I am guessing you are getting will relate to MySQL strict mode. you can disable it if needed

Share this post


Link to post
Share on other sites

Does the error message give a clue as to what the changed data is conflicting with when attempting to execute the UPDATE statement?

Share this post


Link to post
Share on other sites

yes, it says I'm trying to save a record that is been saved by another user, copy to clipboard or drop changes.

i just copied the order_summary table to another server with the same mysql version and same MySQL  NO_ENGINE_SUBSTITUTION, and tried editing a record, it did allow me.  So i believe it's a setting on the live server, just can't figure out what.  Also noticed that when i link the table to Access, it doesn't ask me for primary key...

the error i get is pretty generic of Access DBs, most people say the error will go away if i add a timestamp to the table, which was the original question, but i don't know if that will break any functionality of the shopping cart?

Share this post


Link to post
Share on other sites

I'm just realizing that it's not giving me errors on all records, only on specific ones.  so i starting by sorting the table to try to figure out where is it that i get the errors.

I'm not sure I'm correct, but seems like I have no issues editing records where the field "discount_type" is null, if the record has an "f" in discount_type i cannot edit

What is that field used for?

Thank you!

 

Share this post


Link to post
Share on other sites

i made a copy of order_summary and named it test, i added the timestamp field, now i have no writing conflicts.  So going back to the original question, if i add a timestamp field in order_summary, would that break anything in the shopping cart?

Thank you!

Share this post


Link to post
Share on other sites

No. CubeCart will ignore it. However, the column must not be NOT NULL as otherwise this will require either a default value in the column definition or CubeCart failing an INSERT as not having provided a value for that column.

The 'discount_type' can hold any two characters, but CubeCart uses 'f', 'p', and maybe 'pp', for "Fixed (per-product sale price)", "(global) Percent", and maybe some form of other Percent that I have no experience with. Empty or Null is that this order had no discounts applied.

NO_ENGINE_SUBSTITUTION, if you haven't found out yet, is a setting for the database server that prevents a table from being created or altered if the table is to be created using a specified engine that is not enabled or allowed. See: https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_no_engine_substitution  For example, if InnoDB is not allowed, but MyISAM is, the table will not be created if the CREATE statement says to use InnoDB. With this setting disabled, the table will be created but will use MyISAM (the server default) instead.

 

Share this post


Link to post
Share on other sites

correct!  thank you for your help, as always.

it works correctly now, I have no idea why those records with 'f' in discount were locked... very strange, but i believe it's a bug with Access as usual.

Thank you again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×