批量记录插入
我需要从一个表(多行)中获取数据,并在修改和添加一些新字段后插入到其他表中。
例如:
表 1
项目ID,
价格,
qnt,
date_of_dispatch
表2
发票编号,
发票日期,
客户 ID,
项目ID,
价格,
qnt,
总金额,
发货日期,
grandtotal
请帮我用 ms access 制作它
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
Table2
Invoiceid,
Invoicedate,
customer_id,
itemid,
price,
qnt,
total_amt,
date_of_dispatch,
grandtotal
Please help me to make it in asp with ms access
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在循环中逐条插入第一个表中的记录:
这是基本方法,希望它足够清楚。
编辑:添加了对确认每条记录的支持 - 现在每条记录都会出现复选框,并且仅当选中该复选框时才会发生 INSERT 语句。这将每个
item_id
作为某种“键”,您也可以使用任何其他唯一值。Insert the records one by one in the loop over the records from the first table:
This is the basic approach, hope it's clear enough.
Edit: added support on confirming every record - now checkbox will appear for each record, and only if the checkbox will be Checked the INSERT statement will take place. This is taking each
item_id
as some sort of "key" you can use any other unique value as well.