Solved

Copy a single record within a table.

Posted on 1997-04-08
3
154 Views
Last Modified: 2010-04-04
I need to duplicate a record in a Paradox table (with the exception of two fields - there are 30 fields total!.  Obviously the brute force method is to create 30 temp vars to hold the record to copy and then do an Insert and copy the 30 vars to the new record....Is there a more elegant solution ?  One idea - is it possible to disable the automatic clearing of all fields when an insert is performed ?
0
Comment
Question by:Mike Strauser
  • 2
3 Comments
 
LVL 2

Expert Comment

by:javiertb
ID: 1335254
Try using TBatchMove component.
0
 

Author Comment

by:Mike Strauser
ID: 1335255
Since this is an indexed table and the source and destination are the same table, this would seem to result in a key violation error....and no record is transferred (copied).
0
 
LVL 2

Accepted Solution

by:
javiertb earned 100 total points
ID: 1335256
What about copying the record with TBatchMove to another temporary table, modify the two fields there (I suppose they are the index fields) and then copy this record from the temp table to the final location.  As for your question about not clearing the fields on inserting a new record, the only thing you can do is to use BeforeInsert table event to fill the fields with whatever contents you want (contents not from the same table).
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now