when CachedUpdates=True,submission bulletin " Key violation.
Posted: Tue 11 May 2010 08:03
Delphi7, UniDac 3.0.0.8, Win2003, MSSQL2000
create table dbo.tOrderDtl (
nItem numeric(4) not null,
nGoodsID numeric(8) not null,
nOrderQty numeric(16,3) not null default 0
constraint PK_TORDERDTL primary key nonclustered (nItem)
)
my sql is:
select Item = od.nItem,
GoodsID = od.nGoodsID,
OrderQty = od.nOrderQty
from tOrderDtl od
where od.sStoreNO = 'S110'
and od.sPaperNO = 'S110201004145000'
i use a UniQuery,
Set
CachedUpdates := True
LocalUpdate := True
Options.RequiredFields := False;
Options.SetFieldsReadOnly := False;
The path of the control is:
DBGrid-> DataSource-> ClientDataSet-> DataSetProvider-> UniQuery.
When I enter 1 in GoodsID field of the form, then move the cursor to the next line, enter 2 in the GoodsID field,
then move the cursor to the next line again, it pop error: "Key violation."
for it checks the Item fields of two records are both empty and thinks they're repeated.
But now my setting is "CachedUpdate", I don't like to trigger this inspection.
In addition, when DBGrid-> DataSource-> UniQuery, the above operation is well, no error.
And when the DBGrid-> DataSource-> ClientDataSet-> DataSetProvider-> ADOQuery (or BDEQuery), not error either.
I don't know which caused the problem, or where may I set to shield this inspection?
create table dbo.tOrderDtl (
nItem numeric(4) not null,
nGoodsID numeric(8) not null,
nOrderQty numeric(16,3) not null default 0
constraint PK_TORDERDTL primary key nonclustered (nItem)
)
my sql is:
select Item = od.nItem,
GoodsID = od.nGoodsID,
OrderQty = od.nOrderQty
from tOrderDtl od
where od.sStoreNO = 'S110'
and od.sPaperNO = 'S110201004145000'
i use a UniQuery,
Set
CachedUpdates := True
LocalUpdate := True
Options.RequiredFields := False;
Options.SetFieldsReadOnly := False;
The path of the control is:
DBGrid-> DataSource-> ClientDataSet-> DataSetProvider-> UniQuery.
When I enter 1 in GoodsID field of the form, then move the cursor to the next line, enter 2 in the GoodsID field,
then move the cursor to the next line again, it pop error: "Key violation."
for it checks the Item fields of two records are both empty and thinks they're repeated.
But now my setting is "CachedUpdate", I don't like to trigger this inspection.
In addition, when DBGrid-> DataSource-> UniQuery, the above operation is well, no error.
And when the DBGrid-> DataSource-> ClientDataSet-> DataSetProvider-> ADOQuery (or BDEQuery), not error either.
I don't know which caused the problem, or where may I set to shield this inspection?