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

Difficult copy recordset

P: n/a
I need to create a copy of a record and *all* it's related data, from
*all* it's related tables. The only exception is one of it's primary
keys will be incremented.

This app is an onging project for me, so I really dread manually
quering every field in every table, because of all my upcoming
changes, and because there are abbout 12 tables. I just want to be
able to say "copy all related data and increment the key".

Any ideas would be greatly appriciated.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I'm afraid there is no simple technique for doing this.

I think the simplest way you to write your code would be to create an object
model based on your data model, and provide load and save operations for the
master entity object that recursively execute load or save calls to the
contained objects.

Using this model, you can execute a load to read the data, increment the key
value in the master object instance, then execute a save to write the new copy
back to the database tables.

The code probably won't seem too hairy of you do it with this approach.

On 27 Nov 2004 22:20:38 -0800, Ju********@gmail.com (JumpinJeff) wrote:
I need to create a copy of a record and *all* it's related data, from
*all* it's related tables. The only exception is one of it's primary
keys will be incremented.

This app is an onging project for me, so I really dread manually
quering every field in every table, because of all my upcoming
changes, and because there are abbout 12 tables. I just want to be
able to say "copy all related data and increment the key".

Any ideas would be greatly appriciated.


Nov 13 '05 #2

P: n/a
Well, that's what I suspected I would hear. There are probably very
few reasons for this in rational db design. It's just a frill I want
to add to the app because the old and new records will be almost
identical. It would save a ton of data entry time.

I'm basically a self-taught Access guy, but I haven't delved into the
world of object model yet. I'm going to read up on it now. Do you know
of any info or examples out there?

Thanks for the help.
Steve Jorgensen <no****@nospam.nospam> wrote in message news:<te********************************@4ax.com>. ..
I'm afraid there is no simple technique for doing this.

I think the simplest way you to write your code would be to create an object
model based on your data model, and provide load and save operations for the
master entity object that recursively execute load or save calls to the
contained objects.

Using this model, you can execute a load to read the data, increment the key
value in the master object instance, then execute a save to write the new copy
back to the database tables.

The code probably won't seem too hairy of you do it with this approach.

On 27 Nov 2004 22:20:38 -0800, Ju********@gmail.com (JumpinJeff) wrote:
I need to create a copy of a record and *all* it's related data, from
*all* it's related tables. The only exception is one of it's primary
keys will be incremented.

This app is an onging project for me, so I really dread manually
quering every field in every table, because of all my upcoming
changes, and because there are abbout 12 tables. I just want to be
able to say "copy all related data and increment the key".

Any ideas would be greatly appriciated.

Nov 13 '05 #3

P: n/a
Actually there isn't much really good info about Object Oriented programming
in Classic VB, so I recommend skimming a general introductory book about
Object Oriented programming, then seeing what of it applies to Access. You
can ignore all the inheritance and polymorphism stuff as relates to this
particular task.

On 28 Nov 2004 10:37:50 -0800, Ju********@gmail.com (JumpinJeff) wrote:
Well, that's what I suspected I would hear. There are probably very
few reasons for this in rational db design. It's just a frill I want
to add to the app because the old and new records will be almost
identical. It would save a ton of data entry time.

I'm basically a self-taught Access guy, but I haven't delved into the
world of object model yet. I'm going to read up on it now. Do you know
of any info or examples out there?

Thanks for the help.
Steve Jorgensen <no****@nospam.nospam> wrote in message news:<te********************************@4ax.com>. ..
I'm afraid there is no simple technique for doing this.

I think the simplest way you to write your code would be to create an object
model based on your data model, and provide load and save operations for the
master entity object that recursively execute load or save calls to the
contained objects.

Using this model, you can execute a load to read the data, increment the key
value in the master object instance, then execute a save to write the new copy
back to the database tables.

The code probably won't seem too hairy of you do it with this approach.

On 27 Nov 2004 22:20:38 -0800, Ju********@gmail.com (JumpinJeff) wrote:
>I need to create a copy of a record and *all* it's related data, from
>*all* it's related tables. The only exception is one of it's primary
>keys will be incremented.
>
>This app is an onging project for me, so I really dread manually
>quering every field in every table, because of all my upcoming
>changes, and because there are abbout 12 tables. I just want to be
>able to say "copy all related data and increment the key".
>
>Any ideas would be greatly appriciated.


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.