On 2018/10/12 8:19 PM, Lars Frederiksen wrote:
I type info into some labeledits and by pressing "Append to DB" button this
code is executed (fdqGoser2 is a FDQuery)
fdqGloser2.Open;
fdqGloser2.Append;
fdqGloser2.FieldByName('Graesk').AsString:= ledGræsk.Text;
fdqGloser2.FieldByName('Dansk').AsString:= ledDansk.Text;
fdqGloser2.FieldByName('Lektion').AsString:= ledLektion.Text;
fdqGloser2.FieldByName('Note').AsString:= ledNote.Text;
fdqGloser2.FieldByName('Kategori').AsString:= ledKategori.Text;
fdqGloser2.FieldByName('Langenscheidt').AsString:= ledLangenscheidt.Text;
fdqGloser2.FieldByName('Ordtype').AsString:= ledOrdtype.Text;
fdqGloser2.FieldByName('Boejning').AsString:= ledBøjning.Text;
fdqGloser2.FieldByName('Graesk_ren').AsString:=
Trykløs_SmåBogstaver(fdqGloser2.FieldByName('Graesk').AsString);
fdqGloser2.Post; [ here the error is triggered]
I wonder if some kind of property i fdqGloser2 is set wrong. I think the only
thing I have set i SQL ('SELECT * FROM Gloser2').
Any ideas?
This is a kind of novice way to do it, but should work fine (I'm not
judging, it's just that I'm not 100% sure if Append starts a transaction
or not, or if there is another command to follow Append after the field
values are set, like AddRecord or CloseRecord or some such, before Post
can be called - Prefer doing these lower down and have some control over
it, but happy to do a little trouble-shooting).
What is fdqGloser2? I mean what is its Delphi Type? (T..something... )
I'm guessing fdq is for Fire-DAC-Query, which makes it seem like this is
from some tutorial.
Actually, this question is veering further and further away from an
SQLite question - perhaps we should not spam everyone and move off-list
(along with whomever wish to join).
Send me off-list the entire Unit perhaps and the DB file (at least the
schema if the content is sensitive), then I can have a look at what goes
wrong.
If someone else is interested in contributing to this, send me a mail
too to include in the reply chain.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users