Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help with TTable :Lookup?????????

Status
Not open for further replies.

clifff

Programmer
Mar 22, 2002
20
MD
I am stuck with that crazy variant type that came from Delphy.
here is a simple ex. from help:
<ex>
int C;

AnsiString A;
Variant V;
V = Table1->Lookup(&quot;Company;State&quot;,
VarArrayOf(OPENARRAY(Variant, (&quot;Blue Sports&quot;,&quot;OR&quot;))),
&quot;CustNo;Addr1&quot;);
if !(VarType(V) == varNull)
{
C = V[0];
A = V[1];
ShowMessage(IntToStr(C) + #10 + A);
}
else

ShowMessage(&quot;Search unsuccessful!&quot;);
</ex>

Everytime I receive an exeption : Cant convert AnsiString to Variant.

What is going on?

Can someone give a simple ex. how to use TTable->Lookup?

Thanks clifff.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top