Delphi Pages Forums

Delphi Pages Forums (http://www.delphipages.com/forum/index.php)
-   DB-Aware (http://www.delphipages.com/forum/forumdisplay.php?f=5)
-   -   FireDAC SQLite ERROR (http://www.delphipages.com/forum/showthread.php?t=217789)

larshgf 08-06-2018 06:48 PM

FireDAC SQLite ERROR
 
Hej Liste,

I have created a small database in SQLite with only one table (just in order to check out SQLite). The Table is defined like this:

CREATE TABLE IF NOT EXISTS "Gloser"(
GRAESK VARCHAR(50) NULL,
DANSK VARCHAR(50) NULL,
LEKTION VARCHAR(10) NULL,
NOTE TEXT NULL
);


I use Delphi 10.2 and the FireDAC components.
When I (in my Delphi program) try to write to the database like this:


fdqFlashCard.Append;
fdqFlashCard.FieldByName('GRAESK').AsString:= 'gręsk';
fdqFlashCard.FieldByName('DANSK').AsString:= 'dansk';
fdqFlashCard.FieldByName('LEKTION').AsString:= 'lektion';
fdqFlashCard.Post;

Then I get this error:

[FireDAC][Phys][SQLite]ERROR: Attempt to write a readonly database

I have been searching without a result. Anybody with a helping hint?

BR Lars

rojam 08-14-2018 03:49 PM

Quote:

Originally Posted by larshgf (Post 234244)
Hej Liste,

I have created a small database in SQLite with only one table (just in order to check out SQLite). The Table is defined like this:

CREATE TABLE IF NOT EXISTS "Gloser"(
GRAESK VARCHAR(50) NULL,
DANSK VARCHAR(50) NULL,
LEKTION VARCHAR(10) NULL,
NOTE TEXT NULL
);


I use Delphi 10.2 and the FireDAC components.
When I (in my Delphi program) try to write to the database like this:


fdqFlashCard.Append;
fdqFlashCard.FieldByName('GRAESK').AsString:= 'gręsk';
fdqFlashCard.FieldByName('DANSK').AsString:= 'dansk';
fdqFlashCard.FieldByName('LEKTION').AsString:= 'lektion';
fdqFlashCard.Post;

Then I get this error:

[FireDAC][Phys][SQLite]ERROR: Attempt to write a readonly database

I have been searching without a result. Anybody with a helping hint?

BR Lars

What directory does your database sit on? Do you have WRITE access to that directory?


All times are GMT. The time now is 12:59 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.