Sign in to follow this  
b3rs3rk

Help with ADO

Recommended Posts

I'm writing a small programm in C++ with ADO. Basically i'm trying to insert some tables from a DB in another DB. So i've started with something like this: INSERT INTO dest_table SELECT * FROM src_table IN "c:\src.mdb" Naturally, this works perfectly. But sometimes dest_table already has some records, so if i try to insert again those records (don't ask why, but it could happen) i get an error. What i need is a function that selects the record from src_table that aren't already in dest_table, something like (warning: veeeery pseudo-code :D ) INSERT IN dest_table SELECT * FROM src_table AND NOT IN dest_table Anyone can help?

Share this post


Link to post
Share on other sites
i've tryied something like this, creating a temporary table, copying the values and removing the duplicates with DELETE. After all i copied all the unique records in dest_table and used DROP to remove the temp table.

Works well, but the resulting DB is enormous! Seems that the temporary data (records and table) is not deleted, but only hided...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this