Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Locate returns error on execution


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Sep 11, 2017 10:02 AM Last Post By: charles leggette
charles leggette

Posts: 43
Registered: 7/17/00
Locate returns error on execution  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 11, 2017 8:20 AM
I used to use Locate(...) in my pre-widestring apps......now the following code returns an error
TLocateOptions Opts;
Opts.Clear();
unsigned short bFound = false;
Variant locvalues[2];
locvalues[0] = Variant(s);// s and pn are valid strings present in database and LOGINNAME is a valid Index.
locvalues[1] = Variant(pn);
if (AdoTable->Locate("LOGINNAME", VarArrayOf(locvalues, 1), Opts))
{
return(true);
}

ERROR>>>>EVariantTypeCastError-- could not convert variant of type (Array Variant)into type (OleStr);

Anyone have a clue as to how to use locate in a TADOTable context?
charles leggette

Posts: 43
Registered: 7/17/00
Re: Locate returns error on execution  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 11, 2017 10:02 AM   in response to: charles leggette in response to: charles leggette
charles leggette wrote:
I used to use Locate(...) in my pre-widestring apps......now the following code returns an error
TLocateOptions Opts;
Opts.Clear();
unsigned short bFound = false;
Variant locvalues[2];
locvalues[0] = Variant(s);// s and pn are valid strings present in database and LOGINNAME is a valid Index.
locvalues[1] = Variant(pn);
if (AdoTable->Locate("LOGINNAME", VarArrayOf(locvalues, 1), Opts))
{
return(true);
}

ERROR>>>>EVariantTypeCastError-- could not convert variant of type (Array Variant)into type (OleStr);

Anyone have a clue as to how to use locate in a TADOTable context?

This was posted to the wrong site...it should have been posted to the General Site.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02