Cannot modify a read-only dataset

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
arusoft
Posts: 45
Joined: Thu 06 Sep 2012 20:19

Cannot modify a read-only dataset

Post by arusoft » Thu 06 Sep 2012 21:14

Hi ,

We are using TUniQuery to edit a row from a access database.
SQL for query is something like this

UniQuery.SQL.Text:= 'Select * from "TableName" where sqlid = :sqlid'
UniQuery.params[0].Value := FSQLID;
UniQuery.Edit

but when we try to do UniQuery.Edit we getting the error "Cannot modify a read-only dataset"

I checked that isReadonly is false and unidirectional is false too. But when I checked canModify its returning as false. Realy not sure what's going on

Please help.

Thanks.

arusoft
Posts: 45
Joined: Thu 06 Sep 2012 20:19

Re: Cannot modify a read-only dataset

Post by arusoft » Thu 06 Sep 2012 22:02

**Sorry earlier I forgot to mention that I do set query to active. UniQuery.Active:=True; **

I want to update further that when I changed the SQL by removing quotes from table name , its working good.

So now the question is what's the reason when I set active, its getting active and even showing me rows with value, but when I edit its gives error and when table name dose not have quotes all works good.

Thanks.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Re: Cannot modify a read-only dataset

Post by bork » Fri 07 Sep 2012 13:19

Hello

To help you to resolve this issue, we need to know which data provider (or database) you are using.

arusoft
Posts: 45
Joined: Thu 06 Sep 2012 20:19

Re: Cannot modify a read-only dataset

Post by arusoft » Fri 07 Sep 2012 13:40

Thanks for reply.

I am getting this error while using access database.

Thank You.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Re: Cannot modify a read-only dataset

Post by bork » Mon 10 Sep 2012 14:10

MS Access doesn't allow to create tables with case-sensitive names. For MS Access the table names TableName and TABLENAME are the same. So you shouldn't use quotes in table names. The сorrect queries are:
Select * from TableName where sqlid = :sqlid
or
Select * from [TableName] where sqlid = :sqlid

arusoft
Posts: 45
Joined: Thu 06 Sep 2012 20:19

Re: Cannot modify a read-only dataset

Post by arusoft » Fri 14 Sep 2012 13:43

Thanks for reply. I forgot to update, but I did noticed that after removing the quotes it worked good.

Thanks.

Post Reply