LookUP function

Hi Im having a problem using lookUp function.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
	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',  




closed account (3hM2Nwbp)
Assuming you're developing in Visual Studio:

1) Check the call stack and find out which line is throwing
2) Research the method that's throwing (it should be well-documented from Microsoft)

Good luck!
Topic archived. No new replies allowed.