Solved

Copy a single record within a table.

Posted on 1997-04-08
3
159 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to implement a row column color change using Dev Express Quantum Grid in Delphi 3 77
Delphi 2 91
Reconfigure Delphi Install? 2 78
creating threads in delphi 1 202
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…

752 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