Results 1 to 6 of 6

Thread: Blank Date displays at 12/30/1899

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736

    Question

    I have a table containing date fields. When I display those fields using Text boxes or Masked Edit boxes, the fields that are blank display 12/30/1899.

    The dataFormat property of the text boxes is set to Date, and the format property of the Masket Edit boxes is set to "mm/dd/yyyy".

    With no formatting, the blank dates display as 12:00:00 AM.

    Fields that contain dates are displaying fine.

    Any ideas of how to get a blank date in the table to display as a blank in a text box or Masked Edit box ?

    Thanks.

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Posts
    81
    Are Nulls allowed in that column? What DB is it? Are the textboxes databound or are you filling them programatically?

    Toot
    Some cause happiness wherever they go; others, whenever they go.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    I have tried it with NULLS allowed and without NULLS. I am currently reading a Visual FoxPro Database, but have also noticed the problem in reading from SQL Server 7.0 tables.

    I am binding the fields to the recordset through code in the form load event.

  4. #4
    Lively Member
    Join Date
    Mar 2000
    Posts
    81
    The only time I've seen this was using DAO with an access back-end and something was happening between the VB app and the DB whereby NULL-allowed fields were filled with "0"s. We quickly moved away from DAO and also tend not to bind controls if poss.
    I presume your DB still looks OK? The null fields haven't been filled in for you, have they?

    T
    Some cause happiness wherever they go; others, whenever they go.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    I am using ADO for my connections, and made sure the fields I am looking at are blank in the Database.

    I tried setting up a DataEnvironment connection and recordset, and also tried using an ADO data control and get the same results.

    I'll keep experimenting with it.

    Thanks.

    [Edited by jbart on 09-18-2000 at 10:18 AM]

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736

    Thumbs up

    In case anyone else runs across this problem, here is what was done to solve the problem.

    The FoxPro table was modified to allow the date fields to accept NULL values. Then a replace command was run against the table to place "null" into the date fields that contained blanks.

    Then the fields displayed correctly on the form.

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