Database Search

areang
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Post by areang »

Hil All !

seek customer name by where the address

Code: Select all

static function LookAddress(cFind)
local cOldFine := cFind
local xFind, oDlg
loca nRec := customer->(recno())
local cFind1 := alltrim(cFind),i,n,oFind
local aData := {}

customer->(dbSetOrder(2)) // index by address
customer->(dbGotop())
do while !customer->(eof())
   for i := 1 to 30-len(cCari1)
       xFind := subs(customer->address,i,len(cFind1))
       if alltrim(xFind) == alltrim(cOldFind)
          aadd(aData,customer->name+" "+customer->address )
          xFind := customer->name
          exit
       endif
   next
   customer->(dbSkip())
enddo
xFind := cOldFind
if len(aData) # 0
   DEFINE DIALOG oDlg FROM 1,1 TO 400,650 PIXEL TITLE "Address "+alltrim(cOldCari)+" "+alltrim(str(len(adata),4))+" Orang"
   @1,2 LISTBOX oFind VAR xFind ITEMS aData SIZE 320,178 OF oDlg pixel
   @182,75 button "Oke" size 30,12 of oDlg pixel  action ( odlg:End() )

   ACTIVATE DIALOG oDlg CENTERED

endif
return alltrim(xFind)
regard
areang
Last edited by areang on Tue Feb 06, 2007 4:07 am, edited 1 time in total.
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Thank you for your answer.

I tried to add the search-fields - and it is working.

locate for UPPER( (alltrim(suchbeg))) $ (UPPER(kunden->name) + UPPER(kunden->vorname ) )
Ollie
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Post by Ollie »

Does anyone have a full text solution that looks in MEMO fields as well?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Post Reply