Sorry if this has been addressed before, but I can't find a good reference
for what I'm trying to do.

I'm trying to figure out the "best" way to design and code a windows app.
that allows a user to enter data that will be stored in two related tables
in an Access 2000 database. (ya-ya, I know, use SQL Server...can't right
now).

I've got a grid bound to a typed Data Set. The DS contains two tables
Orders and Items, related by a unique Order ID. Users select a grid row and
the all the data for the cooresponding record is displayed on a data entry
form (unbound) for viewing and/or editing. I'm having problems updating and
deleting child records in the database. Parent rows work OK. I feel like
I'm missing something basic in the handling of Data Sets during updates and
can't find any examples of the best way to handle updates of parent/child
tables using Access. Can someone point me to a good explaination? TIA.

Steve

Re: Need help with Parent/Child table update by William

William
Wed Sep 08 17:15:37 CDT 2004

Yup we've talked about this many times. David Sceppa has it in his favorite
responses file.
The basics:
Delete children first
Add, change and delete parents
Add and Update children

This way you don't end up with orphaned children.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Steve Clark" <None@None.com> wrote in message
news:%23L6ihMclEHA.3816@TK2MSFTNGP14.phx.gbl...
> Sorry if this has been addressed before, but I can't find a good reference
> for what I'm trying to do.
>
> I'm trying to figure out the "best" way to design and code a windows app.
> that allows a user to enter data that will be stored in two related tables
> in an Access 2000 database. (ya-ya, I know, use SQL Server...can't right
> now).
>
> I've got a grid bound to a typed Data Set. The DS contains two tables
> Orders and Items, related by a unique Order ID. Users select a grid row
> and
> the all the data for the cooresponding record is displayed on a data entry
> form (unbound) for viewing and/or editing. I'm having problems updating
> and
> deleting child records in the database. Parent rows work OK. I feel like
> I'm missing something basic in the handling of Data Sets during updates
> and
> can't find any examples of the best way to handle updates of parent/child
> tables using Access. Can someone point me to a good explaination? TIA.
>
> Steve
>
>



Re: Need help with Parent/Child table update by Steve

Steve
Thu Sep 09 11:12:27 CDT 2004

I guess that makes, Bill, thanks. I guess that means I just can't call:
daChild.Update(ds)
daParent.Update(ds)

Does that mean I have to use the ds.GetChanges (dsRowState.xxxx) method to
sift thru the datasets looking for the specifics groups of deleted, modified
or added rows? Seems kind of tedious...no help from the data adaptor wizard
for this?

Steve

"William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message
news:O5KZfFflEHA.2764@TK2MSFTNGP11.phx.gbl...
> Yup we've talked about this many times. David Sceppa has it in his
favorite
> responses file.
> The basics:
> Delete children first
> Add, change and delete parents
> Add and Update children
>
> This way you don't end up with orphaned children.
>
> hth
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> __________________________________
>
> "Steve Clark" <None@None.com> wrote in message
> news:%23L6ihMclEHA.3816@TK2MSFTNGP14.phx.gbl...
> > Sorry if this has been addressed before, but I can't find a good
reference
> > for what I'm trying to do.
> >
> > I'm trying to figure out the "best" way to design and code a windows
app.
> > that allows a user to enter data that will be stored in two related
tables
> > in an Access 2000 database. (ya-ya, I know, use SQL Server...can't right
> > now).
> >
> > I've got a grid bound to a typed Data Set. The DS contains two tables
> > Orders and Items, related by a unique Order ID. Users select a grid row
> > and
> > the all the data for the cooresponding record is displayed on a data
entry
> > form (unbound) for viewing and/or editing. I'm having problems updating
> > and
> > deleting child records in the database. Parent rows work OK. I feel
like
> > I'm missing something basic in the handling of Data Sets during updates
> > and
> > can't find any examples of the best way to handle updates of
parent/child
> > tables using Access. Can someone point me to a good explaination? TIA.
> >
> > Steve
> >
> >
>
>



Re: Need help with Parent/Child table update by William

William
Thu Sep 09 12:45:21 CDT 2004

Right. You have to use the relationships to update just the children and
just the parents. Since they are in separate tables, this is easy--just do
an Update(dtChild)
Sure, filter on the rowstate as well to get the deleted children...

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Steve Clark" <None@None.com> wrote in message
news:OeqOSfolEHA.2224@tk2msftngp13.phx.gbl...
>I guess that makes, Bill, thanks. I guess that means I just can't call:
> daChild.Update(ds)
> daParent.Update(ds)
>
> Does that mean I have to use the ds.GetChanges (dsRowState.xxxx) method to
> sift thru the datasets looking for the specifics groups of deleted,
> modified
> or added rows? Seems kind of tedious...no help from the data adaptor
> wizard
> for this?
>
> Steve
>
> "William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message
> news:O5KZfFflEHA.2764@TK2MSFTNGP11.phx.gbl...
>> Yup we've talked about this many times. David Sceppa has it in his
> favorite
>> responses file.
>> The basics:
>> Delete children first
>> Add, change and delete parents
>> Add and Update children
>>
>> This way you don't end up with orphaned children.
>>
>> hth
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant
>> Microsoft MVP
>> www.betav.com
>> Please reply only to the newsgroup so that others can benefit.
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>> __________________________________
>>
>> "Steve Clark" <None@None.com> wrote in message
>> news:%23L6ihMclEHA.3816@TK2MSFTNGP14.phx.gbl...
>> > Sorry if this has been addressed before, but I can't find a good
> reference
>> > for what I'm trying to do.
>> >
>> > I'm trying to figure out the "best" way to design and code a windows
> app.
>> > that allows a user to enter data that will be stored in two related
> tables
>> > in an Access 2000 database. (ya-ya, I know, use SQL Server...can't
>> > right
>> > now).
>> >
>> > I've got a grid bound to a typed Data Set. The DS contains two tables
>> > Orders and Items, related by a unique Order ID. Users select a grid
>> > row
>> > and
>> > the all the data for the cooresponding record is displayed on a data
> entry
>> > form (unbound) for viewing and/or editing. I'm having problems updating
>> > and
>> > deleting child records in the database. Parent rows work OK. I feel
> like
>> > I'm missing something basic in the handling of Data Sets during updates
>> > and
>> > can't find any examples of the best way to handle updates of
> parent/child
>> > tables using Access. Can someone point me to a good explaination?
>> > TIA.
>> >
>> > Steve
>> >
>> >
>>
>>
>
>