Discussion:
applylocate problem when using "=="
(too old to reply)
Dan Lancour
2008-11-13 06:46:17 UTC
Permalink
When using the following statement when set exact is off, I get a syntax error. If I set exact on in the desktop properties, then it works. I am using the "==" operator to get an exact match so I do not see the reason to also have exact on because the "==" operator is supposed to act just as if exact is on. Does anyone understand this ?

form.qryCONTRIBUTIONTYPE1.rowset.applylocate;
( [ ContributionType == ']+form.sCTSelected+['] )

Dan Lancour
Roland Wingerter
2008-11-13 07:22:39 UTC
Permalink
Post by Dan Lancour
When using the following statement when set exact is off, I get a syntax
error. If I set exact on in the desktop properties, then it works. I am
using the "==" operator to get an exact match so I do not see the reason
to also have exact on because the "==" operator is supposed to act just
as if exact is on. Does anyone understand this ?
form.qryCONTRIBUTIONTYPE1.rowset.applylocate;
( [ ContributionType == ']+form.sCTSelected+['] )
----------
applyLocate() has its pecularities, some of the standard dBASE syntax just
cannot be used.

Note this line in the OLH: "call applyLocate( ) with a parameter string that
contains an SQL condition expression." I don't think "==" works in an SQL
statement.

Check out the rowset.locateOptions property. If rowset locateOptions = 0
(Match length and case, which is the default) applyLocate() will find exact
matches only.

Roland
Bruce R. Roland
2008-11-13 12:53:14 UTC
Permalink
Dan,

Ditto to what Roland said RE: locateoptions (A parameter of the rowset class). I had just the opposite problem from what you do - i.e., I wanted to find only partial matches but when I first used APPLYLOCATE() I would get "no match found" until I discovered LOCATEOPTIONS. With this I can get a partial match - or an exact match - as desired (and I don't use set esact to do so). Just look up the LOCATEOPTIONS parameter either in the rowset class or help for a list of the options and place a "LOCATEOPTIONS = <?>" line in your forms rowset class definition and this should solve your problem.

Bruce
Ken Mayer [dBVIPS]
2008-11-13 13:33:44 UTC
Permalink
Post by Dan Lancour
When using the following statement when set exact is off, I get a syntax error. If I set exact on in the desktop properties, then it works. I am using the "==" operator to get an exact match so I do not see the reason to also have exact on because the "==" operator is supposed to act just as if exact is on. Does anyone understand this ?
form.qryCONTRIBUTIONTYPE1.rowset.applylocate;
( [ ContributionType == ']+form.sCTSelected+['] )
applyLocate, filter and so on, do not recognize dBASE's "==" symbol.
Change it to a standard equal sign (=), and it should work fine.

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Dan Lancour
2008-11-13 17:11:52 UTC
Permalink
Post by Dan Lancour
When using the following statement when set exact is off, I get a syntax error. If I set exact on in the desktop properties, then it works. I am using the "==" operator to get an exact match so I do not see the reason to also have exact on because the "==" operator is supposed to act just as if exact is on. Does anyone understand this ?
form.qryCONTRIBUTIONTYPE1.rowset.applylocate;
( [ ContributionType == ']+form.sCTSelected+['] )
Dan Lancour
Thanks for all of the quick responses.
Loading...