Page 1 of 1

Cannot modify a read-only dataset

Posted: Thu 06 Sep 2012 21:14
by arusoft
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.

Re: Cannot modify a read-only dataset

Posted: Thu 06 Sep 2012 22:02
by arusoft
**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.

Re: Cannot modify a read-only dataset

Posted: Fri 07 Sep 2012 13:19
by bork
Hello

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

Re: Cannot modify a read-only dataset

Posted: Fri 07 Sep 2012 13:40
by arusoft
Thanks for reply.

I am getting this error while using access database.

Thank You.

Re: Cannot modify a read-only dataset

Posted: Mon 10 Sep 2012 14:10
by bork
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

Re: Cannot modify a read-only dataset

Posted: Fri 14 Sep 2012 13:43
by arusoft
Thanks for reply. I forgot to update, but I did noticed that after removing the quotes it worked good.

Thanks.