TLiteQuery.edit and append don't work

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Francisco
Posts: 5
Joined: Thu 06 Jun 2013 20:17

TLiteQuery.edit and append don't work

Post by Francisco » Mon 10 Jun 2013 13:44

Hello,
in SQLite 2.0.1 for Delphi XE4:

var
Q: TLitequery;
begin
Q:=TLiteQuery.Create(nil);
Q.Connection:=someLiteConnection;
Q.SQL.Text:='select * from test';
Q.Open;
Q.Edit;
//or Q.Insert or Q.Append
...

When line "Q.Edit" is called, this causes an error in data.db line 3183 with errormsg "A read-only database can not be changed" (geman ->english)
Thanks for any help

ZEuS
Devart Team
Posts: 236
Joined: Thu 05 Apr 2012 07:32

Re: TLiteQuery.edit and append don't work

Post by ZEuS » Wed 12 Jun 2013 14:40

Unfortunately, we can not reproduce the problem.
Please make sure that the database file does not have the "Read-only" attribute (right-click on the file in Windows Explorer, select the "Properties" menu item, and look for the "Attributes" section on the "General" tab).
If the file does not have the attribute, please, create a small test database that demonstrates the problem and send it to eugeniyz*devart*com.

Francisco
Posts: 5
Joined: Thu 06 Jun 2013 20:17

Re: TLiteQuery.edit and append don't work

Post by Francisco » Wed 12 Jun 2013 23:05

Hello,
of course the db is not read only. everything worked until I installed the last update which was sent to me by Alex. This update I had to do because some queries like SELECT COUNT (*) and so on did not work. Now the queries work, but not" Dataset.edit" oder "Dataset.append". I sent you a db file.

ZEuS
Devart Team
Posts: 236
Joined: Thu 05 Apr 2012 07:32

Re: TLiteQuery.edit and append don't work

Post by ZEuS » Thu 13 Jun 2013 08:29

We have reproduced the problem with "Cannot modify a read-only dataset" error message on Mac OS X. The error is due to the fact that the SQLite client library, that is supplied by default on Mac OS X, is built without the SQLITE_ENABLE_COLUMN_METADATA compiler directive. Therefore, LiteDAC cannot retrieve dataset metadata correctly and the dataset becomes read-only.
To solve the problem, you should add the following line before opening the query:
Q.Options.SetFieldsReadOnly := False;
We will investigate the possibility of implementing a bypass of such SQLite limitation on Mac OS X in one of the next LiteDAC releases.

ZEuS
Devart Team
Posts: 236
Joined: Thu 05 Apr 2012 07:32

Re: TLiteQuery.edit and append don't work

Post by ZEuS » Thu 22 Aug 2013 09:34

We have fixed the issue and will include the fix in the next LiteDAC release.

Post Reply