add query result into table

cnsg
04-15-2004, 08:08 PM
suppose rst is the recordset after query,i want to create a temporary table on server to store them for use in next procedure,how can i add the recordset into the table? thanks!

Shurik12
04-16-2004, 02:16 AM
1) by looping through the 'source' recordset and execting "INSERT INTO ..." against the Connection or Command objects
2) by opening the second recordset (based on the target table), looping through
the 'source' recordset and using .AddNew method
3) by inlcuding the sql statement behind the 'source' recordset into the "INSERT INTO.." and executing it, meaning:

INSERT INTO Table1 (Field1, Field2)
SELECT Field1, Field2 FROM Table2



Shurik.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum