Board index » delphi » DBNavigator.refresh doesn't (refresh) ??

DBNavigator.refresh doesn't (refresh) ??

Hi people,

I have a DBNavigator controlling a  DBGrid which is the detail part of a
master-detail form.  Its datasource uses a Query dataset which  is just :
select * from  detail  where detail.custno = :"custno"
I can edit or add records OK but when I click on the refresh button I get
the error
"Table does not support this operation because it is not uniqely indexed"

The underlying table "detail" has a unique index defined on 2 columns.

Any ideas why this doesn't work?

--
------------------------------------------
|  Craig Kinsman
|  Control Innovation
|  cra...@comsys.com.au
-------------------------------------------

 

Re:DBNavigator.refresh doesn't (refresh) ??


Hi!
TQuery creates the cursor and it can't have primary key!
You must do close and open query. It posible to insert thiis code to
Navigator event:
procedure TForm1.DBNavigator1Click(Sender: TObject; Button: TNavigateBtn);
begin
     case Button of
     nbRefresh : begin
                    Query1.Close;
                    Query1.Open;
                    abort; // don't execute standart process
               end;
     else
     end;
end;

Quote
Craig Kinsman wrote:
> Hi people,

> I have a DBNavigator controlling a  DBGrid which is the detail part of a
> master-detail form.  Its datasource uses a Query dataset which  is just :
> select * from  detail  where detail.custno = :"custno"
> I can edit or add records OK but when I click on the refresh button I get
> the error
> "Table does not support this operation because it is not uniqely indexed"

> The underlying table "detail" has a unique index defined on 2 columns.

> Any ideas why this doesn't work?

> --
> ------------------------------------------
> |  Craig Kinsman
> |  Control Innovation
> |  cra...@comsys.com.au
> -------------------------------------------

--
Alexander Somov
Softservice SSP, Moscow
ORACLE & INPRISE (BORLAND) PARTNER
tel/fax (095) 333-6310, 128-9341, 128-1821
http://www.softexpress.ru

Other Threads