Some fields not getting written correctly
Posted: Sun 31 Jan 2016 18:18
The code below is not behaving as I thought it would. When this code runs, the [UpdateFN] and [SQL] fields remain null but [Applied] and [Status] get correct data. I know there is something in each of the variables, both since the LiteSQL1.Execute actually does its job and updates database AND because on debug I see correct text assigned to FN
Am I missing something? I'm really puzzled because the code below, which also executes on startup does correctly insert data into the table.
Code: Select all
UpdatesApplied.Open;
UpdatesApplied.Edit;
UpdatesApplied.Append;
FN:=extractfilename(SQL_FN);
UpdatesApplied.FieldByName('UpdateFN').AsString:=quotedstr(FN);
UpdatesApplied.FieldByName('SQL').AsString:=quotedstr(LiteSQL1.SQL.GetText);
UpdatesApplied.Fieldbyname('Applied').AsDateTime:=Now();
UpdatesApplied.Fieldbyname('Status').AsString:='PENDING';
updatesapplied.Post;
Code: Select all
DBM.UpdatesApplied.Open;
DBM.UpdatesApplied.Append;
DBM.UpdatesApplied.FieldByName('UpdateFN').AsString:=extractfilename(Application.Title)+' '+VersionTxt;
DBM.UpdatesApplied.FieldByName('SQL').AsString:=VersionTxt;
DBM.UpdatesApplied.FieldByName('Applied').AsDateTime:=now();
DBM.UpdatesApplied.FieldByName('Status').AsString:='1ST_RUN';
DBM.UpdatesApplied.Post;