1 Reply Latest reply on Sep 5, 2008 3:04 AM by Gelatinous_Blob

    CS3 breaks MS Access date format on insert record

    Gelatinous_Blob
      This is odd.

      I've been working on one of my old sites, built in MX 2004. After updating the insert record behaviour on the page using CS3, I notice my date fields are messed up. My LCID is set to 2057 for UK date format (dd/mm/yyyy), but this is now getting flipped to mm/dd/yyyy.

      I seem to remember there being a "Date, MS Access" option in the "Submit As" drop down in the insert record behaviour in MX 2004, but this seems to be absent.

      Nothing I do on output can reverse the change, so now my old records display dates in the correct format, and new records have the wrong date on them.

      And of course, you only notice this error until the 12th of the month, after which point the system can decide which must be the month.

      Thus my clients are ringing me up two weeks after the update to tell me their application is broken. Arrgh.

      Is there an extension to fix this / add the necessaru to the Insert Record behaviour, or has anyone got a code snippet that works?

      Is this something of a bug in CS3?
        • 1. CS3 breaks MS Access date format on insert record
          Gelatinous_Blob Level 1
          OK, I found a quick and dirty workaround, which is basically not to submit the field as a date.

          I found I needed to change this line of code:

          quote:

          MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 135, 1, -1, MM_IIF(UploadFormRequest("article_date_updated"), UploadFormRequest("article_date_updated"), null)) ' adDBTimeStamp


          with this:

          quote:

          MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 150, MM_IIF(UploadFormRequest("article_date_updated"), UploadFormRequest("article_date_updated"), null)) ' adDBTimeStamp


          The difference being these parameters: "135, 1, -1" becomes "202, 1, 150".

          I don't fully understand what these are (can't seem to find a reference for them) but the third must be the length of the string, the first the type of data (e.g. text variables, number, date) and the middle one, not sure, whether its required perhaps?

          If the first of these parameters could be adjusted to the correct date type, that would be the right solution, but I don't know if this is possible.

          Anyway, the work around is OK - provided there is sufficient validation on the form to pick up invalid date formats.