Jump to content
tobenschain

FindNearest doesn't work

Recommended Posts

I can't understand why this doesn't work

 

Using FireDAC with SQLite and  TFDTable, this returns RecNo of -1

findkeyw := '8F';
ABudSys_DB.IndexFieldNames := 'key';
ABudSys_DB.IndexName := 'KeyIdx';
ABudSys_DB.FindNearest([findkeyw]);

This also returns RecNo of -1

findkeyw := '8F30';
ABudSys_DB.IndexFieldNames := 'key';
ABudSys_DB.IndexName := 'KeyIdx';
if ABudSys_DB.FindKey([findkeyw]) then

File has for index

8A43
8F30
8F31

Share this post


Link to post

Can you list the following settings for the TFDTable instance:

  • CachedUpdates
  • FetchOptions.Unidirectional
  • FetchOptions.CursorKind
  • FetchOptions.LiveWindowParanoic

Also, is KeyIdx a primary or unique key?

Share this post


Link to post

CachedUpdates                              false
FetchOptions.Unidirectional           false
FetchOptions.CursorKind                ckAutomatic
FetchOptions.LiveWindowParanoic false
 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×