gotokey does not find it

Hello,

ich habe einen Table mit
I have a table with

Name  and other fields...
'a'
'b'
'c'
'd'

Its an MS-Access 97 Database
I use Delphi 5 Enterprise and
native Access-Driver

the Cursor is at 'c'

i do (to find the last entry)

setkey;
fieldbyName('Name').AsString = 'd';
if gotokey then
begin
  // found!
end else
begin
  // not found?
end;

and the debugger is jumping to not found!

Where is the problem? How to fix it?
Any help wanted...

TimmermannAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TimmermannAuthor Commented:
PS: the String Name is up to 100 Chars long
0
kretzschmarCommented:
hi timmermann,

möglicherweise ..
maybe it helps to use
gotonearest instead of gotokey,
because the index, which is used may have more than one field.

meikl
0
JaymolCommented:
Or even try using Locate.  (I find that rather good actually!)

John.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TimmermannAuthor Commented:
Hello Jaymol...

i was just trying locate, then your
comment came in.

if Locate('Name', Str, [loPartialKey]) then ..

Why does this work and why does gotokey
work NOT? Can you say that?

------------------
Hello Krezschmar

i also tried gotonearest but it does
not work!

Why?

Name is indexed and no duplicates are
allowed.

-----

Hendrik

PS: Points will come soon
0
TimmermannAuthor Commented:
see also

de.comp.lang.delphi.datenbanken

(German)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.