Results 1 to 2 of 2

Thread: DAO - reading .mdb date field affected by Windows local date format

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2017
    Posts
    19

    DAO - reading .mdb date field affected by Windows local date format

    <Solved> But since I have been programming VB6 DAO for many years and only just found this, I thought I'd leave a note here.

    I write dates to an .MDB file as DD MMM YYYY (eg 23 Jun 2018) in a "date type" field (column).

    For many years I opened the Table and used DAO to read the field and it gave me (eg.) 23 Jun 2018.

    Now I have found that if Windows local date format is set (for example) to YYYY-MM-DD, then DAO will return 2018-06-23.

    Anyway, that solved my problem why my program worked on most PCs, but not on one or two.

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: DAO - reading .mdb date field affected by Windows local date format

    Right, because dates don't really have a format to them ... It's just the visual representation of the value (which is a decimal number behind the scenes). That's why one should always use the appropriate data type (date/datetime) and not worry about the format itself, except when displaying it.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width