Page 1 of 1

TLiteQuery.edit and append don't work

Posted: Mon 10 Jun 2013 13:44
by Francisco
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

Re: TLiteQuery.edit and append don't work

Posted: Wed 12 Jun 2013 14:40
by ZEuS
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.

Re: TLiteQuery.edit and append don't work

Posted: Wed 12 Jun 2013 23:05
by Francisco
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.

Re: TLiteQuery.edit and append don't work

Posted: Thu 13 Jun 2013 08:29
by ZEuS
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.

Re: TLiteQuery.edit and append don't work

Posted: Thu 22 Aug 2013 09:34
by ZEuS
We have fixed the issue and will include the fix in the next LiteDAC release.