Multiple record insert - Classsic ASP

百般思念 提交于 2019-12-11 07:01:39

问题


I need to fetch data from one table (multiple rows) and insert into other table after modifying and adding some new fields.

For example:

Table 1 itemid, price, qnt, date_of_dispatch ,etc

Table2 Invoiceid, Invoicedate, customer_id, itemid, price, qnt, total_amt, date_of_dispatch, grandtotal

Please help me to make it in Classic asp with ms access

in first stage I will fetch record in page from table one (multiple rows) so user can modify , then after click save button insert all data in present form into table2.

Please help...


回答1:


This is more of a SQL question than classic ASP question. Capture the IDs of the updated records from the form (list of comma separated ID values) and then and change your SQL to be something like this:

Insert into Table2 (Field1, Field2, Field3)
Select Field1, Field2, Field3 From Table1 Where ID IN (Comma Separated List of IDs)


来源:https://stackoverflow.com/questions/5467708/multiple-record-insert-classsic-asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!