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. 3 1981
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********@gmai l.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.
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********@gmai l.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.
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********@gmai l.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********@gmai l.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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tlm |
last post by:
Hello All,
I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also
has a subform embedded in it (SubFrmC) The form's recordsource is based on a
table (TblA). SubFrmB's recordsource is also based on a table (TblB).
SubFrmC's recordsource is also based on a table (TblC).
There is a one-to-many relationship between TblA (one) and TblB (many).
|
by: Geir Baardsen |
last post by:
Hi!
This is a routine for copying a recordset into a new order.
It has worked fine under Win98. However, my client has changed to
Win XP, and suddenly it doesn't work anymore. I keep getting the
following error message: Object is not in collection.
So I do a very thorough check and doublecheck of fieldnames from underlying
table, tblOrderDetails. I even write them down in NotePad, and compares them...
but there is no difference. I even...
|
by: Geir Baardsen |
last post by:
Hi!
As you can see I have worked with my code and done some changes. Now
the code will execute, because of this, and because I took away some
code in the OnCurrent event that was probably causing a clash. It does
in fact copy the new Invoice number and the data from tblOrderDetails,
but still missing is the CustID-field, that it refuses to copy. The
CustID-field is a Combobox on frmOrders, and is by no way locked or...
I again have...
|
by: david |
last post by:
Hi,
I've been reading tons of posts on how to copy records, but to no
avail....i'm still stuck.
There are three tables: Main, Sub-Form1 & Sub-Form2
I have a form which displays some data.
The PK (ProductID) for each record on the form is an AUTONUMBER.
This form also has a sub-form, linked via ProductID. The subform also
|
by: Eric |
last post by:
I want to open up 2 record sets. Then, copy everything from one record
set to another (excluding a few fields). Is this possible?
I need to exclude my primary key, and fields starting with "TMP_".
I'm trying this, but it's saying ADODB.Recordset error '800a0c93'
Operation is not allowed in this context.
| |
by: Jim Devenish |
last post by:
I wish to copy a table on a SQL Server backend to a table on an Access
(.mdb) front end in the simplest way.
I have the following to get the recordset but am seeking something
easier.
Dim theConnectionString
theConnectionString = "Driver=SQL Server;
Server=Server;Database=myData;Trusted_Connection=Yes"
|
by: mustang123 |
last post by:
Hi,
I get data from sybase server using ADO Connection and disconnected recordset in my access Database.
Now I have a disconnected recordset. I want to insert the contents of this recordset into a Access table. I can loop through the recordset and insert record by record. But I want to do a bulk insert/Update assuming the columns are the same in the recordset and the table.
How can I copy a recordset data to a table in one shot?
The...
|
by: Richnep |
last post by:
Hi all,
I have tabbed subforms where I need to copy one field value from one
subform over to another subform. Although I can run an update query to
accomplish this I would like to do it through VBA.
sub tables relationships are 1:N with the main table.
So the recods display like this in the subform:
|
by: Neelesh2007 |
last post by:
Hi all,
I have project with VB6.0 and Access-2003. I have datagrid and ADODC as datasource to retrieve records from database. To export the data of datagrid to Excel I am using Copy From Recordset Method. It works fine but when I apply Filter on Adodc Recordset, The Copy From Recordset Method Export All Records in Excel File. I want to export ony Filtered Recordset to Excel File. How can I do this?
Thanks
Neelesh.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |