Thread View: borland.public.cppbuilder.database.multi-tier
3 messages
3 total messages
Started by Ingo Sigl
Thu, 30 Dec 1999 00:00
Table->Locate in > 1 fields
Author: Ingo Sigl
Date: Thu, 30 Dec 1999 00:00
Date: Thu, 30 Dec 1999 00:00
33 lines
1212 bytes
1212 bytes
I use the Table->locate method for the search in more than one fields.
The search in one field is ok with
String test;
Table->Locate("Company", test, Opts);
But the search in more than one fields is not functionating. I always
get the
result "false" also if the datarecord exists. The code ist the same like
in the help
example:
TLocateOptions Opts;
Opts.Clear();
Opts << loPartialKey;
Variant locvalues[2];
String test, test1;
locvalues[0] = Variant(test0);
locvalues[1] = Variant(test1);
CustTable->Locate("Company;Contact", VarArrayOf(locvalues, 1), Opts);
What is wrong with the function in C++??? In Delphi itworks quite well.
Many thanx for any help!!!
ingo.sigl@online.de
Re: Table->Locate in > 1 fields
Author: Mark Cashman
Date: Thu, 30 Dec 1999 00:00
Date: Thu, 30 Dec 1999 00:00
18 lines
1019 bytes
1019 bytes
Hi, Ingo!
Try
Variant KeyValues[] = { "Content1", 12345 };
TLocateOptions LocateOptions << loCaseInsensitive;
Table1->Locate("Field1;Field2", Variant(KeyValues,1), LocateOptions);
Hopefully that will work. I found it via
http://www.mers.com/searchsite.html
------
Mark Cashman, TeamB C++ Builder
http://www.temporaldoorway.com/programming/index.htm
C++ Builder, JBuilder programming information
Home of The C++ Builder Programmer's Webring - Join us!
------
Re: Table->Locate in > 1 fields
Author: CyberNIK
Date: Thu, 30 Dec 1999 00:00
Date: Thu, 30 Dec 1999 00:00
46 lines
1743 bytes
1743 bytes
Ingo Sigl wrote in message <386B726A.60020506@online.de>...
>
>I use the Table->locate method for the search in more than one fields.
>The search in one field is ok with
>
>String test;
>
>Table->Locate("Company", test, Opts);
>
>
>But the search in more than one fields is not functionating. I always
>get the
>result "false" also if the datarecord exists. The code ist the same like
>in the help
>example:
>
>
>TLocateOptions Opts;
>Opts.Clear();
>Opts << loPartialKey;
>Variant locvalues[2];
>
>String test, test1;
>
>locvalues[0] = Variant(test0);
>locvalues[1] = Variant(test1);
>CustTable->Locate("Company;Contact", VarArrayOf(locvalues, 1), Opts);
>
>
>What is wrong with the function in C++??? In Delphi itworks quite well.
>
>Many thanx for any help!!!
>
Hi!
Code such this caused my server part of multi-tier application to crash.
Sometiems it works fine (!), sometimes not. I mentioned that problem
is in invocation of VarArrayOf(...). Instead of it I tried to use
VarArrayCreate and than fill this array.
I would use filtering with the same conditions in your example.
CyberNIK
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads