Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005
    Location
    Cheshire, UK
    Posts
    542
    Plugin Contributions
    3

    Default How will changing these dates affect functionality?

    Shortened story:
    I am developing a system which automates the creation of zencart tables into an offline database using MS Access. Tables are created and populated fine with the exception of the fields in tables which use the following date format: 0001-01-01 00:00:00

    Ms Access does not like this format for many reasons so I need to change it. But this format is used by the zencart installer when creating the tables so if I changed it how would Zencart cope?

    The most sensible option at my disposal will be to use Now() to set the date and time in MSAccess. This will set the current date and time in the format 01/01/2001 00:00:00. When my system exports this as a mysql dump file the code looks like:

    date_added DATETIME NOT NULL DEFAULT Now(),

    Will zencart work with this or will it introduce bugs?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: How will changing these dates affect functionality?

    "0001-01-01 00:00:00" is effectively the same as a blank date.
    Zen Cart code was altered several versions ago to support this as equivalent to blank or even "0000-00-00" and still remain compatible with other database engines besides MySQL ... ie: postgres can't handle "0000-00-00", but treats "0001-01-01" as a blank or zero value.

    Converting "0001-01-01 00:00:00" to "now()" would be incorrect, and could cause many date-calculation problems.

    Since you're writing custom code to export to MySQL, just treat it as blank in your ms access app (using whatever msaccess wants for "blank"), and when you do your output for mysql, translate the blanks to "0001-01-01 00:00:00".
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2005
    Location
    Cheshire, UK
    Posts
    542
    Plugin Contributions
    3

    Default Re: How will changing these dates affect functionality?

    Thanks for clarifying this for me. I have adjusted the VBA code so although the field shows #Error? in MS Access it will export the correct blank date in the mysql dump file.

    Cheers

    Jim

 

 

Similar Threads

  1. Paypal how will this affect us (answer: it doesn't)
    By scooby3134 in forum Addon Payment Modules
    Replies: 2
    Last Post: 16 Mar 2014, 01:57 PM
  2. v150 Will changing attributes on a product affect prior purchases?
    By treblesand in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 25 Apr 2013, 01:44 PM
  3. How Will Removing the \ affect functionality?
    By JollyJim in forum General Questions
    Replies: 5
    Last Post: 6 Dec 2009, 03:42 PM
  4. Changing 'These items will be in stock soon' to an image?
    By dropbop in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 3 Jan 2009, 03:13 PM
  5. How to put ‘These items will be in stock soon‘ in 2nd language
    By Peace Freak in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 1 Oct 2006, 03:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR