I've got a db that was originally in FoxPro. All the data was pulled out and put into a large table in access 2000. I had to completely redesign the tables (the old db used 2 tables with over 100 columns and 1 reference!!) and now I can't figure out how to insert the old data. I have the primary key (donorID) in the new table (donors) set to autonumber so all new entries will get the new number. If I just copy and paste the old values from the old table (DP) then the primary key values (DONOR2) are erased and set with the autonumber. I have to keep the new donorID and the old DONOR2 values identical.
If I use the RunSQL command and insert using SQL, I can override the autonumber. This will work but I have 20000 records to do this to.. that isn't going to work for me. How can I make a SQL statement in VBA that will read the number from the old table and write it to the new table?
INSERT INTO donors (donorID) VALUES (???);
I need this info in the ??? part
SELECT donor2 FROM dp;
Does SQL have a method of doing something like this? I'm open to any other suggestion too. The main key is that all the donorID numbers match in the new table because they are referenced to several other tables.
I hope I haven't confused anybody. -Dustin
Rom 8:28
If I use the RunSQL command and insert using SQL, I can override the autonumber. This will work but I have 20000 records to do this to.. that isn't going to work for me. How can I make a SQL statement in VBA that will read the number from the old table and write it to the new table?
INSERT INTO donors (donorID) VALUES (???);
I need this info in the ??? part
SELECT donor2 FROM dp;
Does SQL have a method of doing something like this? I'm open to any other suggestion too. The main key is that all the donorID numbers match in the new table because they are referenced to several other tables.
I hope I haven't confused anybody. -Dustin
Rom 8:28