D
dennist
In ADO I had no trouble doing the following: My Access
tables would usually have autonumbering ID fields as the
key. Other values were required. Some had default
values. Using the dataforms, or grids or code, when I
added a row I wouldn't put in a value for those fields
with default values. ADO and visual basic 6 took care of
it. The row would update without a problem.
Now, using dataforms, I cannot add a row. Here is the
layout of the tables:
The five fields for DateType are:
ID autonumber key field
DateType text required no default value
CreateDate Date/Time GeneralDate required default value =
Now
ChangeDate Date/Time GeneralDate required default value =
Now
Active Yes/No required default value = Yes
If I use a grid with the dataform, fill in the field that
is required but which does not have a default value, the
autonumber works but when I click update I get the
following error:
grid: The field 'DateType.CreateDate' cannot contain a
Null value because the required property for this field
is set to true. enter a value in this field.
Individual text boxes: One thing I don't like is when you
press 'Add' button the values for the first row remain in
the text boxes. Second dislike: If I delete contents of
text boxes with changedate and createdate, the original
values just pop up again. The default values are now(),
but the values that pop up are the values for the first
row. When I click update I get the error message
Concurrency violation: The UpdateCommand affected 0
records.
How to I update a table with default values without
having to put in values for those columns. That's the
whole idea of default values. Second, with individual
text boxes, how can I get blank fields when I press adds?
I thought ado.net was supposed to make things easier for
us. But my experience so far is that things that I
learned to do in a few minutes in vb6 and ado I can't
learn to do at all in ado.net.
If I get this question answered, I have further
questions. If not, I'll just use ado and record sets.
It's not as if I haven't read. I bought a number of
books - visual basic.net for microsoft access databases,
ado.net step by step, ado.net core reference, vb.net step
by step, vb.net core reference and three more. I'm not a
programming wizard, but I'm reasonably bright and am
interested in the problems I have to solve.
Any help will be appreciated.
dennist
tables would usually have autonumbering ID fields as the
key. Other values were required. Some had default
values. Using the dataforms, or grids or code, when I
added a row I wouldn't put in a value for those fields
with default values. ADO and visual basic 6 took care of
it. The row would update without a problem.
Now, using dataforms, I cannot add a row. Here is the
layout of the tables:
The five fields for DateType are:
ID autonumber key field
DateType text required no default value
CreateDate Date/Time GeneralDate required default value =
Now
ChangeDate Date/Time GeneralDate required default value =
Now
Active Yes/No required default value = Yes
If I use a grid with the dataform, fill in the field that
is required but which does not have a default value, the
autonumber works but when I click update I get the
following error:
grid: The field 'DateType.CreateDate' cannot contain a
Null value because the required property for this field
is set to true. enter a value in this field.
Individual text boxes: One thing I don't like is when you
press 'Add' button the values for the first row remain in
the text boxes. Second dislike: If I delete contents of
text boxes with changedate and createdate, the original
values just pop up again. The default values are now(),
but the values that pop up are the values for the first
row. When I click update I get the error message
Concurrency violation: The UpdateCommand affected 0
records.
How to I update a table with default values without
having to put in values for those columns. That's the
whole idea of default values. Second, with individual
text boxes, how can I get blank fields when I press adds?
I thought ado.net was supposed to make things easier for
us. But my experience so far is that things that I
learned to do in a few minutes in vb6 and ado I can't
learn to do at all in ado.net.
If I get this question answered, I have further
questions. If not, I'll just use ado and record sets.
It's not as if I haven't read. I bought a number of
books - visual basic.net for microsoft access databases,
ado.net step by step, ado.net core reference, vb.net step
by step, vb.net core reference and three more. I'm not a
programming wizard, but I'm reasonably bright and am
interested in the problems I have to solve.
Any help will be appreciated.
dennist