Some fields not getting written correctly

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
nszmnsky
Posts: 11
Joined: Wed 21 May 2014 17:07

Some fields not getting written correctly

Post by nszmnsky » 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

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;
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

         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;

MaximG
Devart Team
Posts: 1030
Joined: Mon 06 Jul 2015 11:34

Re: Some fields not getting written correctly

Post by MaximG » Tue 02 Feb 2016 12:12

Please describe the issue in more details in order for us to investigate it. In addition, send us a small example that demonstrates the problem, including a test DB, to maximg*devart*com .

Post Reply