How to insert data from un-indexed tabel to indexed table 
Author Message
 How to insert data from un-indexed tabel to indexed table

Hi,

I have two tables in MS Access 97, one table is indexed, another one is an
un-indexed table which has some repeating records.Now I want to transfer
data from the un-indexed table to the indexed table (if the data is
repeated, I will only transfer the first record from the repeating group).
Anybody knows how to do it in VB6?

Thanks in advance,

Henry



Thu, 03 Feb 2005 13:36:59 GMT  
 How to insert data from un-indexed tabel to indexed table
If the target table has a unique index on the field(s) that determine
repetition, you can simply execute a statement to copy all the records from
the source to the target:

SQL = "INSERT INTO TargetTable SELECT * FROM SourceTable;"
db.Execute SQL

The insert will fail on the duplicate records but succeed on the rest.


Quote:
> Hi,

> I have two tables in MS Access 97, one table is indexed, another one is an
> un-indexed table which has some repeating records.Now I want to transfer
> data from the un-indexed table to the indexed table (if the data is
> repeated, I will only transfer the first record from the repeating group).
> Anybody knows how to do it in VB6?

> Thanks in advance,

> Henry



Thu, 03 Feb 2005 13:58:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Too many indexes - Wierd hidden indexes preventing index add

2. Insert record into indexed table

3. FoxPro Data Table & Indexes With VB5

4. Data control locks Access tables with indexes

5. Need syntax to change Index of a Table type Recordset of Data Control

6. Data control locks Access tables with indexes

7. DAO - Fill in foreign key with correct PK index from a string-data table

8. How to get table's index in the tables collection

9. Request for help - limitation of 32 indexes including foreign indexes

10. remove index from field or delete a indexed field

11. Indexes collection contains more indexes that I created????

12. Listview add index and retrieve index?

 

 
Powered by phpBB® Forum Software