有关ADO多表相连的问题,很经典,请高手进来看看!!(80分)

  • 主题发起人 主题发起人 tomol
  • 开始时间 开始时间
T

tomol

Unregistered / Unconfirmed
GUEST, unregistred user!
若是用DBNavigator控件来Insert的话,ADO自动会向相关表中插入数据,有没有办法禁止它
这样做(除了向TADODataSet的Before Insert和TDBNavigator的Before action中添加
代码外)还有什么好办法?
 
请高手帮忙!!!
 
好象有个这样的东西可以起作用,不过我还没试过
ADOQUERY1.properties['Unique table'].value := 'YourTable';
会在删除时起作用。
 
hpretty:你的方法我用过:ADODataSet.RecordSet.Properties['Unique Table'].Value
:='Use Table';但我不知道应该把这句话加在什么地方,我试着在ADODataSet的
BeforeInsert中插入该段代码,但不起作用,请问,这究竟该如何解决???
 
Despite understanding how this works, a better way of looking at this problem is through
the user’s eyes. From their point of view, when they delete a row in the grid, do they intend
to delete just the product or both the product and the supplier? I would wager that 99% of
users expect the former and not the latter. Fortunately you can achieve exactly this with our
old friend, the dynamic property—in this case, the Unique Table dynamic property. You can
specify that deletes refer to just the Products table and not to Suppliers using the following
line of code:
ADOQuery1.Properties[‘Unique Table’].Value := ‘Products’;

As this value cannot be assigned at design time, the next best alternative is to place this line in
the form’s OnCreate event.
For me, updatable joins are just one of many examples of how the designers of ADO have
replaced traditional problems with elegant solutions.

这是原文,你自己看好了
 
这个问题很复杂,QQ给你,我跟你聊聊
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
I
回复
0
查看
609
import
I
I
回复
0
查看
638
import
I
后退
顶部