如何更新多个表的记录? [英] How to update records of multiple tables?
本文介绍了如何更新多个表的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Private Sub BtnEdit1_Click()
SQL = "SELECT * FROM ASSET_OPTION"
RS.Open SQL, CON, 1, 2
RS.AddNew
Else
RS.Open "SELECT A.*,B.* FROM ASSET_OPTION A,ASSET B WHERE B.AID=A.AID AND ASSET_NAME= '" & Combo4.Text & "'", CON, 1, 2
End If
RS!AO_ID = Text1.Text
RS!AID = Combo4.ItemData(Combo4.ListIndex)
RS!LOC_ID = Combo1.ItemData(Combo1.ListIndex)
RS!IDLE_SINCE_DATE = DTPicker2.Value
RS!REASON_IDLE = Text8.Text
RS!UTILIZED_PERIOD = DTPicker3.Value
RS!FREE_ON_DATE = DTPicker4.Value
RS!P_COST = Text3.Text
RS!P_DATE = DTPicker1.Value
RS!CURRENT_STATUS = Combo2.Text
RS!SALE_STRATEGY = Text7.Text
RS!OFFER_RECEIVED = Text5.Text
RS!EXPECTED_VAL = Text6.Text
RS.Update
RS.Close
End Sub
我有
[1]资产大师带援助PK,
[2]位置大师与lo c_id PK,
[3] Asset_option表有FK'的帮助和loc_id和ao_id PK .........
现在我想修改资产和asset_option的loc_id以及使用上面的代码(使用asset_option表)......
上面的代码更新了资产的loc_id只掌握它自己的表asset_master ....
Plz help .........
I am having
[1] Asset master with aid PK,
[2] Location master with loc_id PK,
[3] Asset_option table having FK''s aid and loc_id and ao_id PK.........
Now I wanna modify loc_id of asset and asset_option as well using above code(using asset_option table)......
The above code updates loc_id of asset master only not of it''s own table asset_master....
Plz help.........
推荐答案
hi cool_sari
您可以使用该表的触发器来插入记录
hi cool_sari
you can use trigger of that table you are insert the record
这篇关于如何更新多个表的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文