Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread FindKey not working
Tue, Jun 26 2007 4:48 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Can anyone think of a reason why "if EMails.FindKey([MailBox]) then" fails whilst" EMails.SetRange([MailBox],[MailBox]);" returns the right result?

Roy Lambert
Tue, Jun 26 2007 10:30 AMPermanent Link

Dave Harrison
Roy Lambert wrote:

> Can anyone think of a reason why "if EMails.FindKey([MailBox]) then" fails whilst" EMails.SetRange([MailBox],[MailBox]);" returns the right result?
>
> Roy Lambert

Roy,
   Are there blanks at the end of the field? Case sensitivity?
Corrupted index? Is it a compound index?

Dave
Tue, Jun 26 2007 11:25 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Dave


Good guesses. I should have said - single integer field index.

Roy Lambert
Tue, Jun 26 2007 11:57 AMPermanent Link

Dave Harrison
Roy Lambert wrote:
> Dave
>
>
> Good guesses. I should have said - single integer field index.
>
> Roy Lambert
>
Roy,
   I'd rebuild the index if you haven't already done so. If it is a
simple integer index, the Range and FindKey should both work, even if
the index was descending. Did you try it from dbSys? If all else fails,
this looks like "A JOB FOR SUPER TIM!!". Smile

Dave
Tue, Jun 26 2007 1:09 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Can anyone think of a reason why "if EMails.FindKey([MailBox]) then"
fails whilst" EMails.SetRange([MailBox],[MailBox]);" returns the right
result? >>

Most likely, corruption.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jun 27 2007 4:10 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Dave/Tim


Just remembered one of the other things I tried - I checked that MailBox was indeed integer, and help the correct value - YES to both, I then substituted a literal 2 for MailBox in the FindKey and it worked. Why I don't know.

Anyway I'm going with SetRange since that also removes a need to test that the field is equal to MailBox in the loop and will therefore be a bit (probably undetectable) faster.

Roy Lambert
Thu, Jun 28 2007 11:53 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Just remembered one of the other things I tried - I checked that MailBox
was indeed integer, and help the correct value - YES to both, I then
substituted a literal 2 for MailBox in the FindKey and it worked. Why I
don't know. >>

You do know that there is absolutely no way that those two statements are
both true, right ? Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jun 28 2007 1:42 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

><< Just remembered one of the other things I tried - I checked that MailBox
>was indeed integer, and help the correct value - YES to both, I then
>substituted a literal 2 for MailBox in the FindKey and it worked. Why I
>don't know. >>
>
>You do know that there is absolutely no way that those two statements are
>both true, right ? Smiley

I suspect so, but my eyeballs assured me otherwise <bigger g>

Roy Lambert
Thu, Jun 28 2007 3:56 PMPermanent Link

Dave Harrison
Roy Lambert wrote:

> Tim
>
>
>><< Just remembered one of the other things I tried - I checked that MailBox
>>was indeed integer, and help the correct value - YES to both, I then
>>substituted a literal 2 for MailBox in the FindKey and it worked. Why I
>>don't know. >>
>>
>>You do know that there is absolutely no way that those two statements are
>>both true, right ? Smiley
>
>
> I suspect so, but my eyeballs assured me otherwise <bigger g>
>
> Roy Lambert
>

Roy,
   Looks like a conversion problem? Maybe it is trying to convert
integer to something else? I'm thinking maybe the table definition is
screwed up?

A couple of ideas:
1) Try copying the table to a new table using dbSys and see if it works
on the new table.
2) Unload the table schema to SQL and look at it under a magnifying
glass. (Post it here if you like)
3) Take 2 aspirin (or 2 shots of Wild Turkey-your choice) and get some
sleep. Things will look better in the morning. Smile

Dave
Fri, Jun 29 2007 2:59 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Dave


Thanks for the suggestions, but since SetRange works, and is actually better I'm ignoring the horror.

Roy Lambert
Page 1 of 2Next Page »
Jump to Page:  1 2
Image