Article View: borland.public.cppbuilder.database.ado
Article #4780Re: Creating lookupfield using more than one keyfield.
From: Jirzi
Date: Sat, 20 Oct 2001 11:12
Date: Sat, 20 Oct 2001 11:12
41 lines
1797 bytes
1797 bytes
You probaly saw this, but anyway:
int C;
AnsiString A;
Variant V;
V = Table1->Lookup("Company;State", VarArrayOf(OPENARRAY(Variant, ("Blue
Sports","OR"))), CustNo;Addr1");
if !(VarType(V) == varNull)
{
C = V[0];
A = V[1];
ShowMessage(IntToStr(C) + #10 + A);
}
else
ShowMessage("Search unsuccessful!");
For KeyFields you should use VarArray.
Maybe this helps.
Jirzi
"Erik" <erik@ietsbinnenaxi.nl> wrote in message news:3bd018eb_1@dnews...
> I have a problem creating a lookupfield using more than one keyfield.
(When
> I use just one keyfield all goes well).
> According to the C++ help I should set the KeyFields and the
LookupKeyFields
> property of my TField and seperate each keyfield name with a semicolon.
When
> I do so the following error arises:
>
> ADOTabe: Field 'keyfield1;keyfield2' not found.
>
> Any ideas?
>
> Lots of thanks.
>
> Erik.
>
>
Technical Details
Message-ID:
<3bd15add_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3bd018eb_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,f9c09aab118be781 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-10-20 04:08:34 PST From: "Jirzi" <norc@mailexcite.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3bd018eb_1@dnews> Subject: Re: Creating lookupfield using more than one keyfield. Date: Sat, 20 Oct 2001 13:12:13 +0200 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2479.0006 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006 NNTP-Posting-Host: 194.249.12.49 Message-ID: <3bd15add_2@dnews> X-Trace: dnews 1003576029 194.249.12.49 (20 Oct 2001 04:07:09 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews