Board index » delphi » How to solve "Index is read only"?

How to solve "Index is read only"?

Quote
Diviner Chan wrote:

> I have two tables, which has Master&Detail relatiopship. After link them
> up by setting the MasterSource, MasterField and IndexName properties in
> Detail table, everything seems alright. But when I run it and try to put
> some data to the detail table, an exception "Index is read only"
> occurred.

I had this problem , then learned that you must have a field with a
unique index in every p'dox table, even if you don't need the field.  I
assume you already have a unique (primary index) field in your Master
table, but do you have a unique field in your detail table?

Glenn Galbraith

 

Re:How to solve "Index is read only"?


Quote
In article <33975FA2.5...@pcisys.net> gglo...@pcisys.net writes:
>> I have two tables, which has Master&Detail relatiopship. After link them
>> up by setting the MasterSource, MasterField and IndexName properties in
>> Detail table, everything seems alright. But when I run it and try to put
>> some data to the detail table, an exception "Index is read only"
>> occurred.
>I had this problem , then learned that you must have a field with a
>unique index in every p'dox table, even if you don't need the field.  I
>assume you already have a unique (primary index) field in your Master
>table, but do you have a unique field in your detail table?

Speaking from a pure guess here, it sounds to me like the index might be
non-maintained.  Defining a unique (primary-key) value, even if not used,
enables you to define the index as "maintained."  This might have some bearing
on your problem although I am not specifically familiar with this message.

Re:How to solve "Index is read only"?


I have two tables, which has Master&Detail relatiopship. After link them
up by setting the MasterSource, MasterField and IndexName properties in
Detail table, everything seems alright. But when I run it and try to put
some data to the detail table, an exception "Index is read only"
occurred.

If I undo the link by set off those field mentioned, all the input
operation work completely.

I used paradox 7 as table format and have set version 7 and level 7 in
BDE paradox driver. Is it are properly setting?

Thank you anybody. :)

Diviner Chan.

Re:How to solve "Index is read only"?


Quote
gglo...@pcisys.net wrote:

> Diviner Chan wrote:

> > I have two tables, which has Master&Detail relatiopship. After link them
> > up by setting the MasterSource, MasterField and IndexName properties in
> > Detail table, everything seems alright. But when I run it and try to put
> > some data to the detail table, an exception "Index is read only"
> > occurred.

> I had this problem , then learned that you must have a field with a
> unique index in every p'dox table, even if you don't need the field.  I
> assume you already have a unique (primary index) field in your Master
> table, but do you have a unique field in your detail table?

> Glenn Galbraith

Yes, you have a bingo. I really have lacked in primary index because I
don't need it at the moment. I try to add it afterward, but its not
work. Now I know that, we must create this unique field (also set as
primary key) AT DAY ONE. Even we don't need it as you mentioned.

I know it now. Thank you very much & much. :)

Have a nice learning.

Diviner Chan.

Re:How to solve "Index is read only"?


Quote
Sundial Services wrote:

> In article <33975FA2.5...@pcisys.net> gglo...@pcisys.net writes:

> >> I have two tables, which has Master&Detail relatiopship. After link them
> >> up by setting the MasterSource, MasterField and IndexName properties in
> >> Detail table, everything seems alright. But when I run it and try to put
> >> some data to the detail table, an exception "Index is read only"
> >> occurred.

> >I had this problem , then learned that you must have a field with a
> >unique index in every p'dox table, even if you don't need the field.  I
> >assume you already have a unique (primary index) field in your Master
> >table, but do you have a unique field in your detail table?

> Speaking from a pure guess here, it sounds to me like the index might be
> non-maintained.  Defining a unique (primary-key) value, even if not used,
> enables you to define the index as "maintained."  This might have some bearing
> on your problem although I am not specifically familiar with this message.

Your guessing is totally right! Now the problem is gone. But I found it
even you add this unique afterward, it will not work. You must create
this field once you create this table.

Thank you very much. You helped me a lot. :)

Have a nice learning.

Diviner Chan.

Other Threads