FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Fulltext search in dbf inclusive Memo fields
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Fulltext search in dbf inclusive Memo fields
Posted: Sun Jul 21, 2013 07:10 AM

Hello,
does someone have some code how to search inside a dbf file inclusive Memo fields.
Thanks in advance
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fulltext search in dbf inclusive Memo fields
Posted: Sun Jul 21, 2013 07:45 AM

Otto,

you were using this one:

viewtopic.php?p=80148#p80148

and now want to search in memos too, right ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: Fulltext search in dbf inclusive Memo fields
Posted: Sun Jul 21, 2013 08:45 AM

Hello Antonio,
thank you for your attention. Yes that is what I want to do. I would like to insert also the content of the memo fields in my search function.
Thanks in advance
Otto

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fulltext search in dbf inclusive Memo fields
Posted: Sun Jul 21, 2013 06:21 PM

Otto,

What file extension do you have in your memo files ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fulltext search in dbf inclusive Memo fields
Posted: Sun Jul 21, 2013 06:26 PM

Otto,

Please email me a DBF with a memo file of yours, thanks :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fulltext search in dbf inclusive Memo fields
Posted: Sun Jul 21, 2013 09:45 PM
Otto,

I think the way to do it is to perform a free search inside the FPT file for a string. If found, we have its position inside the file. Then we have to read the DBF record by record starting from the bottom of the DBF and going backwards to the first one (we can do it directly, without using the RDD) as in each record is kept the position of each memo inside the FPT file. Basically:

in pseudo code:
Code (fw): Select all Collapse
local nOffset := At( "string", MemoRead( "myfile.fpt" ) )

if nOffset != 0
   We read the DBF, record by record, starting from the end of the DBF
      while RecordMemoOffset() > nOffset .and. nPosInDbf > 0
          GoPrevRecord()
      end
      if nPosInDbf > 0
         MsgInfo( "found" )
      endif
endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fulltext search in dbf inclusive Memo fields
Posted: Sun Jul 21, 2013 10:04 PM
Otto,

Using FiveDBU I open your DBF and edit the closest field to the memo field:


Now, I review the DBF in binary mode and look for my modified value:


I would say that 44FF is the offset of its memo inside the FPT file. Using Header() and RecSize(), get the position of 44FF, and it should be the same for each record.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fulltext search in dbf inclusive Memo fields
Posted: Sun Jul 21, 2013 10:15 PM

44 :-)

can't be 44FF

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion