Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dates, vb and odbc (XP sp1)

    Quick question, whose root lies (I think) with dates
    I've inherited a VB app which writes to an access database (using add new and update for a ADODB recordset object). I made some modification and everything seemed to be working fine.
    In trying to break it I came across this oddity.

    Scenario 1. Uses a dsn-less connection string (referencing Jet 4) to connect to the database
    Able to input a date like '11/11/1111' (in truth, not likely to be entered) with no errors.

    Scenario 2. Uses a dsn for the connection to the database using the standard ms access driver
    The same date causes an error (-2147467259 with an 'error in row' description), which I've not been able to find any information about.

    I'm just curious as to why one connection method allows a value whilst the other throws up an error but my real question is just what is the minimum acceptable date in Access (I'm sure its looking me in the face but I just can't find it)

    <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dates, vb and odbc (XP sp1)

    In Access 97 and up, valid dates are from 1 January 100 up to and including 31 December 9999. If you enter a year in the range of 0 to 29, it will be interpreted as 2000 to 2029, and if you enter a year in the range of 30 to 99, it will be interpreted as 1930 to 1999. Neagative years and years over 9999 cause an error.

    In older versions of Access, valid dates were from 1 January 1900 to somewhere in June 2079. It might well be that the ODBC driver for Access still checks for this range, for compatibility reasons.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dates, vb and odbc (XP sp1)

    Cheers Hans, this is odd and I'm going to try to forget about it as quickly as possible.

    For info though, (by trial and error after reading your post) the earliest date I've submitted with the dsn connection was 01/01/1753.

    Still confused but not going to worry about it any more <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dates, vb and odbc (XP sp1)

    I don't think it matters, but just for your information: 1753 rang a bell. It is the year in which the Gregorian calendar was standardized. See MSKB article FIX: Incorrect Pre-1753 Date Values With Jet ODBC Driver.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Manchester, Gtr Manchester, England
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dates, vb and odbc (XP sp1)

    Cheers again, I'd been looking for stuff about the Gregorian Calender but never came across that date. I guess its a case of only realising what you were looking for after you've found it!

Posting Permissions

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