CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Location
    Land of sunshine and June Gloom
    Posts
    171

    schema.ini DateTimeFormat legal values

    I have a schema.ini for a text file. The datetimes are stored like in the file

    3/17/2005 13:02:55

    I put the following settings

    [San.txt]
    ColNameHeader=False
    Format=FixedLength
    CharacterSet=OEM
    DateTimeFormat=mm/dd/yyyy hh:mm:ss
    ...

    However, I get an OleDbException that the DateTimeFormat specification is not valid.

    I also tried
    DateTimeFormat="mm/dd/yyyy hh:mm:ss"

    That gives me the same error. Can anyone refer me to a document with the legal OLE DB strings for DateTimeFormat?

    Thanks in advance.

  2. #2
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: schema.ini DateTimeFormat legal values

    I don't know for sure (there are so many tools developed by microsoft that has different formating), but it can be wrong in:

    1) Since there is no 2 digit month and maybe day number too ("3/17/2005..." U should use [DateTimeFormat="m/d/yyyy hh:mm:ss"]

    2) Sometimes character case can be meaningfull, so U may try [DateTimeFormat="M/d/yyyy hh:mm:ss"] or [DateTimeFormat="m/d/yyyy hh:MM:ss"]

    3) sometimes for minutes it is "nn" not "mm"
    Don't giveup, try again

    Anyway,Why Microsoft develop so many standards for the same task ?

    Hope it helps.

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

Featured