Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying a table in Access Database to another table in that Database..

Status
Not open for further replies.

Shocker838

IS-IT--Management
Feb 18, 2001
47
US
i was wondering how to copy a table to another table within the same Microsoft Access Database? "Less work more network" (HP) -- its so catchy
 
Easiest way would be to go into Access, right click on the table, choose copy, and then right click again in the same window, and choose paste....

Otherwise, look into using a CREATE TABLE SQL statement, and then opening up the table you want to copy, and going line by line adding the existing records to the new table --

good luck! :)
Paul Prewett
 
thanks, but i was wondering how to do it using ASP, i will look into the SQL create table, but will that create a new table each time, because i want to append the data...? "Less work more network" (HP) -- its so catchy
 
OH! Yes, CREATE TABLE will create a new table each time.

Here's what you can do if all you want is to add new stuff to the other table...

Both tables would obviously have the same PK.

Create a recordset with table1
Create a recordset with table2

set 'on error resume next' so that no errors are returned --

loop through rs1 and add all values to rs2 until the eof of rs1 -- do a batch update...

It will not add any records that are already there, because your your primary key constraint, but it will add the records that aren't there... but because you turned error catching off, you get no error messages, and there ya go!

:)
Paul Prewett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top