English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I've created delphi6 programs connected to a MS access database. it has 2 tables(not a master-detail), 1 has 5 fields and the other has 7 fields. they have 4 fields in common. all i want to know is how, using sql or something, to move a specific record from 1 table to another. im using ADO approach displaying the database (both tables) in dbgrid.

2006-08-29 18:45:22 · 4 answers · asked by raven_002 1 in Computers & Internet Programming & Design

4 answers

I know nothing whatsoever about delphi but here is the gist of the sql. Assume your primary key is numbered and you are looking at record 10
$variable1 = SELECT Field1 FROM MyTable WHERE PrimaryKey = 1
$variable2 = .... etc
Then assuming these are the first 4 fields run this
INSERT INTO MyTable Values($variable1, $variable2, $variable3, $variable4, '', '', '');

Hope this helps

2006-08-29 18:53:38 · answer #1 · answered by teef_au 6 · 0 0

Assuming both tables are in the access database (the MDB file), execute the following statements:

insert into TableA select from TableB where
delete form TableB

2006-08-29 18:50:55 · answer #2 · answered by m1rr0r 4 · 0 0

Simple SQL command to copy the data!
this will work!

2006-08-29 19:09:14 · answer #3 · answered by Ashish 2 · 0 0

Try drag and drop.

If not given that option, open file, then edit, then view, then tools.

look for this control, if you do not find it open help.

2006-08-29 18:49:50 · answer #4 · answered by Norton N 5 · 0 0

fedest.com, questions and answers