Board index » delphi » Case Table.State : dsEdit when Table is in Data Module

Case Table.State : dsEdit when Table is in Data Module

case Table1.State of
 dsBrowse: Title := 'Browse';

Works fine when the table and datasource are on a form and the code is
written in the unit associated with the form.

Put the table and datasource in a data module and the compiler thinks
dsBrowse is an undeclared identifier, when the following code is written in
the unit associated with a form

case DataM1.DataModule1.Table1.State of
 dsBrowse: Title := 'Browse';

What am I doing wrong?  Can't I test the state of a table from outside a
data module, when the table is in a data module?

Thanks for your help

Charles Wood

 

Re:Case Table.State : dsEdit when Table is in Data Module


You might be missing the db unit in the uses clause of your form's unit.
That is where dsBrowse is declared. It is part of a set type property of
TDataSet (TDataSet.State).

Alain Quesnel

P.S.: mind the brackets in my address

Quote
Charles Wood wrote in message <7r1iv9$r...@forums.borland.com>...
>case Table1.State of
> dsBrowse: Title := 'Browse';

>Works fine when the table and datasource are on a form and the code is
>written in the unit associated with the form.

>Put the table and datasource in a data module and the compiler thinks
>dsBrowse is an undeclared identifier, when the following code is written in
>the unit associated with a form

>case DataM1.DataModule1.Table1.State of
> dsBrowse: Title := 'Browse';

>What am I doing wrong?  Can't I test the state of a table from outside a
>data module, when the table is in a data module?

>Thanks for your help

>Charles Wood

Re:Case Table.State : dsEdit when Table is in Data Module


Try adding the DB unit to the form's uses clause. TDataSetState is declared
in the DB unit.

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to questions received via email)

Re:Case Table.State : dsEdit when Table is in Data Module


That's it!  I'm back in business! :)

wood

Quote
> Try adding the DB unit to the form's uses clause. TDataSetState is
declared
> in the DB unit.

> Bill

> --

> Bill Todd - TeamB
> (TeamB cannot respond to questions received via email)

Other Threads