You are not logged in.
Pages: 1
I just take the Sample1 to point out the strange behavior
A little bit more complex Record ;o)
TSQLSampleRecord = class(TSQLRecord)
private
...
published
property Time: TDateTime read fTime write fTime;
property Name: RawUTF8 read fName write fName;
property Question: RawUTF8 read fQuestion write fQuestion;
property Data1: RawUTF8 read FData1 write FData1;
property Data2: RawUTF8 read FData2 write FData2;
property Data3: RawUTF8 read FData3 write FData3;
end;
and the modified Method in Sample1:
{$DEFINE TESTFILL}
procedure TForm1.FindButtonClick(Sender: TObject);
var Rec: TSQLSampleRecord;
begin
{$IFDEF TESTFILL}
Rec := TSQLSampleRecord.CreateAndFillPrepare(Database,'Name="%"',[StringToUTF8(NameEdit.Text)],'Name,Question');
try
// Rec.ClearProperties; // makes no difference
if not Rec.FillOne then
{$ELSE}
Rec := TSQLSampleRecord.Create(Database,'Name="%"',[StringToUTF8(NameEdit.Text)]);
try
if Rec.ID = 0 then
{$ENDIF}
QuestionMemo.Text := 'Not found' else
QuestionMemo.Text := UTF8ToString(Rec.Question) + '/' +UTF8ToString(Rec.Data1) + '/' +UTF8ToString(Rec.Data3) + '/' +UTF8ToString(Rec.Data3);
finally
Rec.Free;
end;
end;
Running the App in normal way I enter as name 'myname' and as message 'mymessage' and send the message
I type again the name and "Find previous message"
The Result is as expected
mymessage///
ok, that was easy, now we try this with CreateAndFillPrepare
Following the same steps as above will lead us to the following result:
myname/myname/myname/myname
It seems, that the JSONTable is a little bit to busy (and also confused) in filling the field values
Offline
Thanks for the report.
There was an issue in TSQLRecord.FillPrepare when the table has less columns that the filling TSQLTable (can occur e.g. when using aCustomFieldsCSV parameter in FillPrepare method).
Hope it will fix your problem.
Offline
Yes, now it works
:o)
Offline
Pages: 1