By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,839 Members | 2,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,839 IT Pros & Developers. It's quick & easy.

Date Time Picker and empty databases

P: n/a
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.DataSource = adoRecordSet
dtpDate.DataField = "Date Planted"

<Ade
--
Adrian Parker. Ordained priest. <ad***********@sympatico.ca>
Want to know the purpose of life? I'd be happy to share it with you...
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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:Fc*******************@news20.bellglobal.com.. .
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.DataSource = adoRecordSet
dtpDate.DataField = "Date Planted"

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

Jul 17 '05 #2

P: n/a
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" <no*************@comcast.net> wrote in message
news:kP********************@comcast.com...
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:Fc*******************@news20.bellglobal.com.. .
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.DataSource = adoRecordSet
dtpDate.DataField = "Date Planted"

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


Jul 17 '05 #3

P: n/a
"Fuddzy" <ch******@accesscomm.ca> wrote in message
news:3f******@news3.accesscomm.ca...
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
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

"Steve Gerrard" <no*************@comcast.net> wrote in message
news:kP********************@comcast.com...
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:Fc*******************@news20.bellglobal.com.. .
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.DataSource = adoRecordSet
dtpDate.DataField = "Date Planted"

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

you...



Jul 17 '05 #4

P: n/a
"Steve Gerrard" <no*************@comcast.net> wrote in message
news:kP********************@comcast.com...
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.
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.


"Adrian Parker" <no@addy.com> wrote in message
news:Fc*******************@news20.bellglobal.com.. .
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" Set dtpDate.DataSource = adoRecordSet
dtpDate.DataField = "Date Planted"

Jul 17 '05 #5

P: n/a
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............good luck..................

fud
"Adrian Parker" <no@addy.com> wrote in message
news:gT********************@news20.bellglobal.com. ..
"Fuddzy" <ch******@accesscomm.ca> wrote in message
news:3f******@news3.accesscomm.ca...
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
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

"Steve Gerrard" <no*************@comcast.net> wrote in message
news:kP********************@comcast.com...
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:Fc*******************@news20.bellglobal.com.. .
> 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.DataSource = adoRecordSet
> dtpDate.DataField = "Date Planted"
>
>
>
> <Ade
> --
> Adrian Parker. Ordained priest. <ad***********@sympatico.ca>
> Want to know the purpose of life? I'd be happy to share it with

you... >
>



Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.