🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #4677

Re: Creating lookupfield using more than one keyfield.

#4677
From: Erik
Date: Tue, 30 Oct 2001 09:21
88 lines
2904 bytes
Jirzi,

Thanks for your reply, but I dont want to perform a Lookup on a Table.

I want to use a TField with with FieldKind = fkLookup.



The code is like this:

ADOTableUren->FieldByName("opdracht")->FieldKind = fkLookup;

ADOTableUren->FieldByName("opdracht")->KeyFields = "klant_id";

ADOTableUren->FieldByName("opdracht")->LookupDataSet = ADOTableOpdracht;

ADOTableUren->FieldByName("opdracht")->LookupKeyFields = "klant_id";

ADOTableUren->FieldByName("opdracht")->LookupResultField = "omschrijving";




this is working, but now I want to use more than one keyfield, that code is
like:

ADOTableUren->FieldByName("opdracht")->KeyFields = "klant_id;volgnr";

ADOTableUren->FieldByName("opdracht")->LookupKeyFields = "klant_id;volg_nr";




This is not working. The following error arises:

ADOTableUren: Field 'klant_id;volgnr' not found.



Erik



"Jirzi" <norc@mailexcite.com> wrote in message news:3bd15add_2@dnews...
> 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: <3bde6f4c$1_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3bd018eb_1@dnews> <3bd15add_2@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-30 01:20:57 PST
From: "Erik" <erik@ietsbinnenaxi.nl>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3bd018eb_1@dnews> <3bd15add_2@dnews>
Subject: Re: Creating lookupfield using more than one keyfield.
Date: Tue, 30 Oct 2001 10:21:50 +0100
Lines: 90
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 195.108.253.210
Message-ID: <3bde6f4c$1_2@dnews>
X-Trace: dnews 1004433228 195.108.253.210 (30 Oct 2001 01:13:48 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!newsfeed.mesh.ad.jp!uunet!osa.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews