Variant LookupResults;
Variant locvalues;
Variant v;
locvalues = Variant(InputBox("Please enter surname: ","Lastname",""));
LookupResults = DataMod->ADOTableMembers ->Lookup("Lastname",locvalues,
"Surname,Initials;AccountNr;SAIDNum;JoinDate;AccStatus");
// now put the results in a global stringlist (created elsewhere)
ListBox1->Clear();
for (int i = 1; i < 5; i++) // Lookup call requested 5 fields
{
v = LookupResults.GetElement(i);
if (v.IsNull())
ListBox1->Items->Add("");
else
ListBox1->Items->Add(v);
}
But when I run the application and enter a Lastname that exists in the database it give me an exception
*.exe raised exception class EVariantInvalidArgError with message 'Invalid argument',