You are not logged in.
Pages: 1
Hi ab,
While trying to use step through MultiFieldsValues records, I get an exception I can't make my mind around.
For ex. just playing with Sample 04, the following code raises an exception after the Step line...
procedure TForm1.btnTestClick(Sender: TObject);
var
aSampleRecord: TSQLSampleRecord;
s: RawUTF8;
begin
with Database.MultiFieldValues(TSQLSampleRecord, 'Name,Question', 'ID >= ?', [1]) do begin
try
while Step(FALSE, @aSampleRecord) do begin
s := Format('Name: %s; Question: %s', [aSampleRecord.Name, aSampleRecord.Question]);
QuestionMemo.Lines.Add(s);
end;
finally
Free;
end;
end;
end;
-> Project Project04Client.exe raised exception class EVariantBadVarTypeError with message 'Invalid variant type'.
I have no idea what I'm doing wrong, it's just a copy/paste from the documentation :-\
(Delphi 2010)
Offline
Should not work on Sundays. My mind was so blurry...
Offline
Offline
That's what I was using before, and what got me confused when I tried MultiFieldValues: I forgot to change the variable type ! (so ashamed)
Offline
Pages: 1