Database Search

Postby areang » Thu Feb 01, 2007 6:28 am

Hil All !

seek customer name by where the address
Code: Select all  Expand view
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.
areang
 
Posts: 128
Joined: Mon Jul 31, 2006 3:23 pm

Postby Otto » Thu Feb 01, 2007 8:37 am

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 ) )
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Postby Ollie » Wed Nov 26, 2008 12:08 pm

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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests