Date Time Picker and empty databases

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adrian Parker

    Date Time Picker and empty databases

    Hi. I have a date time picker in my program which uses ADO to read from an
    Access database. It works perfectly, unless the database is empty (no
    records) when opened. When you try to open an empty database, the date time
    picker returns error 545. Any attempts to progmatically add new records
    after the empty database has been opened returns, or to use the DTP and set
    a new date for those added records, "Field not updateable, Bound Property
    Name: Value, Field Name: Date Planted"

    Any ideas?


    Set dtpDate.DataSou rce = adoRecordSet
    dtpDate.DataFie ld = "Date Planted"



    <Ade
    --
    Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
    Want to know the purpose of life? I'd be happy to share it with you...


  • Steve Gerrard

    #2
    Re: Date Time Picker and empty databases

    That Date-Time Picker is being a little bit funky.

    If you go to the Date-Time Picker, and set its Checkbox property to true, that
    will allow the bound field to be null. This is what is happening with no
    records, or with new records. Otherwise, it is trying to get a date out of a
    field that is null, which generates the errors you are seeing.

    The user then has to check the box to "activate" the date picker. It ain't the
    prettiest thing I've ever seen, but it should work correctly.

    "Adrian Parker" <no@addy.com> wrote in message
    news:FcZab.9451 $BT1.501778@new s20.bellglobal. com...[color=blue]
    > Hi. I have a date time picker in my program which uses ADO to read from an
    > Access database. It works perfectly, unless the database is empty (no
    > records) when opened. When you try to open an empty database, the date time
    > picker returns error 545. Any attempts to progmatically add new records
    > after the empty database has been opened returns, or to use the DTP and set
    > a new date for those added records, "Field not updateable, Bound Property
    > Name: Value, Field Name: Date Planted"
    >
    > Any ideas?
    >
    >
    > Set dtpDate.DataSou rce = adoRecordSet
    > dtpDate.DataFie ld = "Date Planted"
    >
    >
    >
    > <Ade
    > --
    > Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
    > Want to know the purpose of life? I'd be happy to share it with you...
    >
    >[/color]


    Comment

    • Fuddzy

      #3
      Re: Date Time Picker and empty databases

      why not
      1) check the recordset (on that table or query) and if empty ............
      report that fact back to the user
      or if there are records
      2) check for a NULL in that field and if so............. . report that fact
      back to the user

      Fud

      "Steve Gerrard" <notstevegerrar d@comcast.net> wrote in message
      news:kPqdncVp-sGoMvGiXTWJiA@c omcast.com...[color=blue]
      > That Date-Time Picker is being a little bit funky.
      >
      > If you go to the Date-Time Picker, and set its Checkbox property to true,[/color]
      that[color=blue]
      > will allow the bound field to be null. This is what is happening with no
      > records, or with new records. Otherwise, it is trying to get a date out of[/color]
      a[color=blue]
      > field that is null, which generates the errors you are seeing.
      >
      > The user then has to check the box to "activate" the date picker. It ain't[/color]
      the[color=blue]
      > prettiest thing I've ever seen, but it should work correctly.
      >
      > "Adrian Parker" <no@addy.com> wrote in message
      > news:FcZab.9451 $BT1.501778@new s20.bellglobal. com...[color=green]
      > > Hi. I have a date time picker in my program which uses ADO to read from[/color][/color]
      an[color=blue][color=green]
      > > Access database. It works perfectly, unless the database is empty (no
      > > records) when opened. When you try to open an empty database, the date[/color][/color]
      time[color=blue][color=green]
      > > picker returns error 545. Any attempts to progmatically add new records
      > > after the empty database has been opened returns, or to use the DTP and[/color][/color]
      set[color=blue][color=green]
      > > a new date for those added records, "Field not updateable, Bound[/color][/color]
      Property[color=blue][color=green]
      > > Name: Value, Field Name: Date Planted"
      > >
      > > Any ideas?
      > >
      > >
      > > Set dtpDate.DataSou rce = adoRecordSet
      > > dtpDate.DataFie ld = "Date Planted"
      > >
      > >
      > >
      > > <Ade
      > > --
      > > Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
      > > Want to know the purpose of life? I'd be happy to share it with you...
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Adrian Parker

        #4
        Re: Date Time Picker and empty databases

        "Fuddzy" <chilecom@acces scomm.ca> wrote in message
        news:3f6ceadc@n ews3.accesscomm .ca...[color=blue]
        > why not
        > 1) check the recordset (on that table or query) and if empty ............
        > report that fact back to the user
        > or if there are records
        > 2) check for a NULL in that field and if so............. . report that fact
        > back to the user[/color]

        In this case the user should be allowed to delete all records, close the
        database, and if he wants reopen at a later time and using my program add
        more entries.

        I think the teacher will doc me marks if I don't allow the database to open
        if it's empty.


        Adrian





        [color=blue]
        > "Steve Gerrard" <notstevegerrar d@comcast.net> wrote in message
        > news:kPqdncVp-sGoMvGiXTWJiA@c omcast.com...[color=green]
        > > That Date-Time Picker is being a little bit funky.
        > >
        > > If you go to the Date-Time Picker, and set its Checkbox property to[/color][/color]
        true,[color=blue]
        > that[color=green]
        > > will allow the bound field to be null. This is what is happening with no
        > > records, or with new records. Otherwise, it is trying to get a date out[/color][/color]
        of[color=blue]
        > a[color=green]
        > > field that is null, which generates the errors you are seeing.
        > >
        > > The user then has to check the box to "activate" the date picker. It[/color][/color]
        ain't[color=blue]
        > the[color=green]
        > > prettiest thing I've ever seen, but it should work correctly.
        > >
        > > "Adrian Parker" <no@addy.com> wrote in message
        > > news:FcZab.9451 $BT1.501778@new s20.bellglobal. com...[color=darkred]
        > > > Hi. I have a date time picker in my program which uses ADO to read[/color][/color][/color]
        from[color=blue]
        > an[color=green][color=darkred]
        > > > Access database. It works perfectly, unless the database is empty (no
        > > > records) when opened. When you try to open an empty database, the[/color][/color][/color]
        date[color=blue]
        > time[color=green][color=darkred]
        > > > picker returns error 545. Any attempts to progmatically add new[/color][/color][/color]
        records[color=blue][color=green][color=darkred]
        > > > after the empty database has been opened returns, or to use the DTP[/color][/color][/color]
        and[color=blue]
        > set[color=green][color=darkred]
        > > > a new date for those added records, "Field not updateable, Bound[/color][/color]
        > Property[color=green][color=darkred]
        > > > Name: Value, Field Name: Date Planted"
        > > >
        > > > Any ideas?
        > > >
        > > >
        > > > Set dtpDate.DataSou rce = adoRecordSet
        > > > dtpDate.DataFie ld = "Date Planted"
        > > >
        > > >
        > > >
        > > > <Ade
        > > > --
        > > > Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
        > > > Want to know the purpose of life? I'd be happy to share it with[/color][/color][/color]
        you...[color=blue][color=green][color=darkred]
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Adrian Parker

          #5
          Re: Date Time Picker and empty databases

          "Steve Gerrard" <notstevegerrar d@comcast.net> wrote in message
          news:kPqdncVp-sGoMvGiXTWJiA@c omcast.com...[color=blue]
          > That Date-Time Picker is being a little bit funky.
          >
          > If you go to the Date-Time Picker, and set its Checkbox property to true,[/color]
          that[color=blue]
          > will allow the bound field to be null. This is what is happening with no
          > records, or with new records. Otherwise, it is trying to get a date out of[/color]
          a[color=blue]
          > field that is null, which generates the errors you are seeing.
          >
          > The user then has to check the box to "activate" the date picker. It ain't[/color]
          the[color=blue]
          > prettiest thing I've ever seen, but it should work correctly.[/color]

          Yes, I quite like this fix. It may not be perfect, but it does the job
          well. Besides I can always progmatically check whether it's Null, and set
          the CheckBox value progmatically.

          [color=blue]
          >
          > "Adrian Parker" <no@addy.com> wrote in message
          > news:FcZab.9451 $BT1.501778@new s20.bellglobal. com...[color=green]
          > > Hi. I have a date time picker in my program which uses ADO to read from[/color][/color]
          an[color=blue][color=green]
          > > Access database. It works perfectly, unless the database is empty (no
          > > records) when opened. When you try to open an empty database, the date[/color][/color]
          time[color=blue][color=green]
          > > picker returns error 545. Any attempts to progmatically add new records
          > > after the empty database has been opened returns, or to use the DTP and[/color][/color]
          set[color=blue][color=green]
          > > a new date for those added records, "Field not updateable, Bound[/color][/color]
          Property[color=blue][color=green]
          > > Name: Value, Field Name: Date Planted"[/color][/color]
          [color=blue][color=green]
          > > Set dtpDate.DataSou rce = adoRecordSet
          > > dtpDate.DataFie ld = "Date Planted"[/color][/color]


          Comment

          • Fuddzy

            #6
            Re: Date Time Picker and empty databases

            of course YOU would not give control to the user........... .......... all i
            suggested was the logic required to HANDLE your situation ..the rest is up
            to u............go od luck........... .......

            fud
            "Adrian Parker" <no@addy.com> wrote in message
            news:gT6bb.1120 7$BT1.556182@ne ws20.bellglobal .com...[color=blue]
            > "Fuddzy" <chilecom@acces scomm.ca> wrote in message
            > news:3f6ceadc@n ews3.accesscomm .ca...[color=green]
            > > why not
            > > 1) check the recordset (on that table or query) and if empty[/color][/color]
            .............[color=blue][color=green]
            > > report that fact back to the user
            > > or if there are records
            > > 2) check for a NULL in that field and if so............. . report that[/color][/color]
            fact[color=blue][color=green]
            > > back to the user[/color]
            >
            > In this case the user should be allowed to delete all records, close the
            > database, and if he wants reopen at a later time and using my program add
            > more entries.
            >
            > I think the teacher will doc me marks if I don't allow the database to[/color]
            open[color=blue]
            > if it's empty.
            >
            >
            > Adrian
            >
            >
            >
            >
            >
            >[color=green]
            > > "Steve Gerrard" <notstevegerrar d@comcast.net> wrote in message
            > > news:kPqdncVp-sGoMvGiXTWJiA@c omcast.com...[color=darkred]
            > > > That Date-Time Picker is being a little bit funky.
            > > >
            > > > If you go to the Date-Time Picker, and set its Checkbox property to[/color][/color]
            > true,[color=green]
            > > that[color=darkred]
            > > > will allow the bound field to be null. This is what is happening with[/color][/color][/color]
            no[color=blue][color=green][color=darkred]
            > > > records, or with new records. Otherwise, it is trying to get a date[/color][/color][/color]
            out[color=blue]
            > of[color=green]
            > > a[color=darkred]
            > > > field that is null, which generates the errors you are seeing.
            > > >
            > > > The user then has to check the box to "activate" the date picker. It[/color][/color]
            > ain't[color=green]
            > > the[color=darkred]
            > > > prettiest thing I've ever seen, but it should work correctly.
            > > >
            > > > "Adrian Parker" <no@addy.com> wrote in message
            > > > news:FcZab.9451 $BT1.501778@new s20.bellglobal. com...
            > > > > Hi. I have a date time picker in my program which uses ADO to read[/color][/color]
            > from[color=green]
            > > an[color=darkred]
            > > > > Access database. It works perfectly, unless the database is empty[/color][/color][/color]
            (no[color=blue][color=green][color=darkred]
            > > > > records) when opened. When you try to open an empty database, the[/color][/color]
            > date[color=green]
            > > time[color=darkred]
            > > > > picker returns error 545. Any attempts to progmatically add new[/color][/color]
            > records[color=green][color=darkred]
            > > > > after the empty database has been opened returns, or to use the DTP[/color][/color]
            > and[color=green]
            > > set[color=darkred]
            > > > > a new date for those added records, "Field not updateable, Bound[/color]
            > > Property[color=darkred]
            > > > > Name: Value, Field Name: Date Planted"
            > > > >
            > > > > Any ideas?
            > > > >
            > > > >
            > > > > Set dtpDate.DataSou rce = adoRecordSet
            > > > > dtpDate.DataFie ld = "Date Planted"
            > > > >
            > > > >
            > > > >
            > > > > <Ade
            > > > > --
            > > > > Adrian Parker. Ordained priest. <adrian.parker@ sympatico.ca>
            > > > > Want to know the purpose of life? I'd be happy to share it with[/color][/color]
            > you...[color=green][color=darkred]
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            Working...