Autor Beitrag
Hänsel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 154



BeitragVerfasst: Fr 31.07.26 06:44 
Hallo,
ich benötige wieder einmal eine Hilfe.
Ich habe im DBGrid eine Tabelle angezeigt bekommen. Aus dieser möchte ich einzelne Datensätze löschen (DB= SQLite)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var x1 : String;
begin
x1:='x x x';

 FDQuery_Einlesung.Close;
 FDQuery_Einlesung.SQL.Text:='Select * From Einlesung Where (Feld3<>0) or (Feld5 is null) or (Feld6 is null) or (Feld6 = '''+x1+''')';
 FDQuery_Einlesung.Open;
end;

Auch wenn ich nur FDQuery_Einlesung.delite verwende, bekomme ich die Fehlermeldung "database is locked". Was habe ich hier falsch gemacht bzw. vergessen?

Danke im Voraus
Hänsel

Moderiert von user profile iconTh69: Delphi-Tags hinzugefügt
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4808
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Fr 31.07.26 14:28 
Hast du mehrere gleichzeitige Datenbankzugriffe in deinem Programm? SQLite arbeitet mit einem "file lock", sobald Daten geschrieben werden, s. z.B. Understanding and Resolving the "SQLite Database is Locked" Error.
Hänsel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 154



BeitragVerfasst: Sa 01.08.26 07:24 
Hallo,
danke für die Information. Ich habe noch ein anderes Programm, hier kann es eventuell sein, dass ich beim Schließen die DB bzw. Tabelle nicht richtig geschlossen habe. Ich werde es testen.

Gruß Hänsel