Board index » delphi » problem with 'Unique Table' property

problem with 'Unique Table' property

Hi, everyone!
I want to have an updatable ADODataset which is retrieved with a joined SQL
query. I have set the dynamic property ??Unique Table? to the aimed table,
but I can not edit the data in the DBGrid.
I am using D5 and MS SQL2000.
This is my code:

with ADODataSet1 do begin
  Close;
  CommandText:='select a.f1, a.f2, a.f3, b.f4, b.f5, b.f6 where a.f1=b.f1';
  Open;
  Properties['Unique Table'].Value:='b';
end;

What's wrong with that?

 

Re:problem with 'Unique Table' property


Quote
> with ADODataSet1 do begin
>   Close;
>   CommandText:='select a.f1, a.f2, a.f3, b.f4, b.f5, b.f6 where
a.f1=b.f1';
>   Open;
>   Properties['Unique Table'].Value:='b';
> end;

> What's wrong with that?

Nothing. Your problem is somewhere else.

--
Vassil Nazarov
IT Manager, Sofia Cable SA

Re:problem with 'Unique Table' property


Thank you, Mr. Nazarov!
I have set LockType of the ADODataSet to 'ltBatchOptimistic' and accepted
default settings elsewhere with the TDataSource and TDBGrid components. What
more particular tunings are needed?
Quote
Vassil Nazarov <vas...@mail.orbitel.bg> wrote in message

news:3a78d2f0_1@dnews...
Quote
> > with ADODataSet1 do begin
> >   Close;
> >   CommandText:='select a.f1, a.f2, a.f3, b.f4, b.f5, b.f6 where
> a.f1=b.f1';
> >   Open;
> >   Properties['Unique Table'].Value:='b';
> > end;

> > What's wrong with that?

> Nothing. Your problem is somewhere else.

> --
> Vassil Nazarov
> IT Manager, Sofia Cable SA

Re:problem with 'Unique Table' property


I have tackled it. The reason is I have unexpectedly set the dgEditing to
TRUE for the DBGrid. Sorry. But this time I find the dataset is always
updatable no matter whether I have set the 'Unique Table' property or not.
It seems that this dynamic property is quite superfluous, which is quite
contrary to what is said by MS. Do you think there is some other purpose for
that property?
Thank you again.

Quote
Xia Chengbin <cb...@sina.com> wrote in message news:3a78d95d_1@dnews...
> Thank you, Mr. Nazarov!
> I have set LockType of the ADODataSet to 'ltBatchOptimistic' and accepted
> default settings elsewhere with the TDataSource and TDBGrid components.
What
> more particular tunings are needed?
> Vassil Nazarov <vas...@mail.orbitel.bg> wrote in message
> news:3a78d2f0_1@dnews...
> > > with ADODataSet1 do begin
> > >   Close;
> > >   CommandText:='select a.f1, a.f2, a.f3, b.f4, b.f5, b.f6 where
> > a.f1=b.f1';
> > >   Open;
> > >   Properties['Unique Table'].Value:='b';
> > > end;

> > > What's wrong with that?

> > Nothing. Your problem is somewhere else.

> > --
> > Vassil Nazarov
> > IT Manager, Sofia Cable SA

Re:problem with 'Unique Table' property


Xia
the main reson for that property is to let you delete saftly just the unique
table when you delete
records from a join recordset, with out it it will delete records from all
join tables

you can also use that property with the "Update Resync" dinamic property
you can read on it in the Microsoft Press site or look at the
TBetterADODataSet component
by Vassil to learn more

Regards

    David   B.E    agros...@arava.co.il

Regards

Quote
"Xia Chengbin" <cb...@sina.com> wrote in message news:3a78c810_2@dnews...
> Hi, everyone!
> I want to have an updatable ADODataset which is retrieved with a joined
SQL
> query. I have set the dynamic property ??Unique Table? to the aimed
table,
> but I can not edit the data in the DBGrid.
> I am using D5 and MS SQL2000.
> This is my code:

> with ADODataSet1 do begin
>   Close;
>   CommandText:='select a.f1, a.f2, a.f3, b.f4, b.f5, b.f6 where
a.f1=b.f1';
>   Open;
>   Properties['Unique Table'].Value:='b';
> end;

> What's wrong with that?

Re:problem with 'Unique Table' property


Quote
>the 'Unique Table' property or not.
>It seems that this dynamic property is quite superfluous,

Uniquie table only tells ADO what table gets deleted when you delete a record.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:problem with 'Unique Table' property


Thank you all. I have got it.
Brian Bushay TeamB <BBus...@Nmpls.com> wrote in message
news:0ufk7t0mrmqn6lhre7n6mi798do773ftuc@4ax.com...
Quote

> >the 'Unique Table' property or not.
> >It seems that this dynamic property is quite superfluous,
> Uniquie table only tells ADO what table gets deleted when you delete a
record.

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Other Threads