P
pclover
Unregistered / Unconfirmed
GUEST, unregistred user!
做个两层的MIS系统,经常要用到4,5个表关联,如客户,定单,产品,货币,单位等等,
同时因为UI的需要,要保留客户代码,产品代码等给用户显示/选择,同时想用缓存更新
模式,怎么解决呢?
下面是Borland NewsGroup的讨论,无解,各位高手给个方案吧。
Sanyo,
I know exactly what you are trying to achieve. Unfortunately ADO is not
as flexible as the Borland's T(Client)DataSet model. There's no en efficient
way to achieve TUpdateSQL functionality with ADO that I know of.
There are 3 possible workarounds though.
1. Use client-side lookup fields instead of a joined SQL select statement.
我的理解:用Lookup,假设你有几千个客户,产品,性能会很差。
2. Insert a Provider and a ClientDataSet between the ADODataSet and the
DataSource.
我的理解:若是父子表,得用8个Component,恐怖,也放慢打开速度。
3. Intercept the UpdateBatch call, apply the pending updates via a separate
command object and then Requery the original ADODataSet.
我的理解:等于加个"TAdoUpdateSQL",更新完了还得Requery,更恐怖。
All techniques have their pros and cons but the 1st and the second one are
much simpler to implement and are mostly client-side.
I've seen some third party implementations of a TADOUpdateSQL component
which all employ technique 3 above but they all suffer the overhead imposed by
the additional Requery operation.
Note that not all techniques are applicable in all situations. Things get much more
complicated when BatchUpdates are combined with joined SQL and master/detail.
All these complications descend from the simple fact that MS won't allow us developers
to interfere with the internal generation of their precious update statements. ADO
doesn't even respect its own [Unique Table] property for inserts and updates.
There may be a perfect data connectivity layer but I have yet to see it. <g>
HTH
--
Vassil Nazarov
http://web.orbitel.bg/vassil/
同时因为UI的需要,要保留客户代码,产品代码等给用户显示/选择,同时想用缓存更新
模式,怎么解决呢?
下面是Borland NewsGroup的讨论,无解,各位高手给个方案吧。
Sanyo,
I know exactly what you are trying to achieve. Unfortunately ADO is not
as flexible as the Borland's T(Client)DataSet model. There's no en efficient
way to achieve TUpdateSQL functionality with ADO that I know of.
There are 3 possible workarounds though.
1. Use client-side lookup fields instead of a joined SQL select statement.
我的理解:用Lookup,假设你有几千个客户,产品,性能会很差。
2. Insert a Provider and a ClientDataSet between the ADODataSet and the
DataSource.
我的理解:若是父子表,得用8个Component,恐怖,也放慢打开速度。
3. Intercept the UpdateBatch call, apply the pending updates via a separate
command object and then Requery the original ADODataSet.
我的理解:等于加个"TAdoUpdateSQL",更新完了还得Requery,更恐怖。
All techniques have their pros and cons but the 1st and the second one are
much simpler to implement and are mostly client-side.
I've seen some third party implementations of a TADOUpdateSQL component
which all employ technique 3 above but they all suffer the overhead imposed by
the additional Requery operation.
Note that not all techniques are applicable in all situations. Things get much more
complicated when BatchUpdates are combined with joined SQL and master/detail.
All these complications descend from the simple fact that MS won't allow us developers
to interfere with the internal generation of their precious update statements. ADO
doesn't even respect its own [Unique Table] property for inserts and updates.
There may be a perfect data connectivity layer but I have yet to see it. <g>
HTH
--
Vassil Nazarov
http://web.orbitel.bg/vassil/