Recent

Author Topic: TDBF.Filter and TDBF.Found  (Read 11515 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TDBF.Filter and TDBF.Found
« Reply #15 on: July 18, 2013, 08:17:08 am »
Ok, sorry about this.  I missed your post in this thread.  I'll stick with FPC.  Thanks again.
No problem.

BTW, if you'd want to contribute to/correct the wiki article on tdbf:
http://wiki.lazarus.freepascal.org/Lazarus_Tdbf_Tutorial
be my guest ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

timcs

  • Full Member
  • ***
  • Posts: 213
Re: TDBF.Filter and TDBF.Found
« Reply #16 on: July 18, 2013, 10:01:02 am »
I have been using the DBFRecordFilter function (I think that is what is it called, do not have the code in front of me) this works on the basis that when you set dbf1.filtered:=true  , it looks at this function to do the searching.

You may want to try this method as I have been using it while doing a recent project myself.


Cheers

Tim

tshumak

  • New Member
  • *
  • Posts: 36
Re: TDBF.Filter and TDBF.Found
« Reply #17 on: July 18, 2013, 09:12:32 pm »
OzeCode - Hi,  I'm familliar with .RecordCount and .ExactRecordCount, but I did not know about .PhysicalRecordCount.  I'll have to look back at the DBF components inner workings to learn more.  Thanks for the tip.

« Last Edit: July 18, 2013, 09:29:37 pm by tshumak »

tshumak

  • New Member
  • *
  • Posts: 36
Re: TDBF.Filter and TDBF.Found
« Reply #18 on: July 18, 2013, 09:21:59 pm »
BigChimp - Thank you for the invitation to the wiki article.  I might just add my two cents where appropriate.

tshumak

  • New Member
  • *
  • Posts: 36
Re: TDBF.Filter and TDBF.Found
« Reply #19 on: July 18, 2013, 09:48:32 pm »
So I've been re-writing my project to move away from the .Filter function.  When trying to synchronize 9 tables the application seems to be slow.  I've moved towards setting indexes and using .Next and .Prior methods.  Hence TDBF currently does not support referential integrity, I'm also going to look at .Locate and .Lookup functions.

.Filter is good for Greater than, Less than searching, where as .Locate and .Lookup seem to allow for exact matches.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TDBF.Filter and TDBF.Found
« Reply #20 on: July 19, 2013, 08:30:33 am »
Thanks for your post. In the longer term, I'd be interested in adding referential integrity features into tdbf if possible (haven't looked at that aspect yet)... which would make it a lot more usable IMO... but that time isn't here yet...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

timcs

  • Full Member
  • ***
  • Posts: 213
Re: TDBF.Filter and TDBF.Found
« Reply #21 on: July 19, 2013, 05:56:33 pm »
As per my previous post where this is the logic behind using the Dbf1FilterRecord Function :

  accept := (DateOf(Dataset.FieldByName('dateon').AsDateTime)=DateOf(now))   

This will give you, as an example any records using the dateon field in the DBF file , all records as of today

Thanks

TimCS

tshumak

  • New Member
  • *
  • Posts: 36
Re: TDBF.Filter and TDBF.Found
« Reply #22 on: July 24, 2013, 09:19:52 am »
OzeCode - I looked at ExactRecordCount, this seems to be something I've been looking for.  Thanks.

Using a for loop to iterate through the records found from Filter.

 

TinyPortal © 2005-2018