Seek a record

Seek a record

Postby Silvio » Fri May 08, 2009 5:07 pm

Image


On main program I open the file dbf

USE ( CurDir() + "\Clientes" ) VIA "DBFCDX"
if RecCount() == 0
APPEND BLANK
endif
if ! File( CurDir() + "\CliName.CDX" )
INDEX ON Clientes->Nombre TO ( CurDir() + "\CliName" )
endif
Clientes->( OrdSetFocus( "CliName" ) )
Clientes->( DbGoTop() )

and then on seek function
Code: Select all  Expand view  RUN


static function SeekClient( oLbx )

  local cNombre := Space( 30 )
  local nRecNo  := clientes->(RecNo())

  SET SOFTSEEK ON

   Clientes->( OrdSetFocus( "CliName" ) )


   if MsgGet( "Search", "Customer Name", @cNombre,;
              "lupa.bmp" )

      if !  clientes->( DbSeek(  cNombre, .t. ) )
         MsgAlert( "I don't find that customer" )
         GO nRecNo
      else
         oLbx:UpStable()           // Corrects same page stabilizing Bug
         oLbx:Refresh()            // Repaint the ListBox
      endif
   endif

return nil



where I make error ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Seek a record

Postby TecniSoftware » Fri May 08, 2009 7:39 pm

Silvio:

Evidentemente no está abriendo el índice.

Prueba con:

if !File( CurDir() + "\CliName.CDX" )
INDEX ON Clientes->Nombre TO ( CurDir() + "\CliName" )
endif

Clientes->(DbSetIndex( CurDir() + "\CliName" ))

Clientes->( OrdSetFocus( "CliName" ) )
Clientes->( DbGoTop() )

Saludos!
Alejandro Cebolido
Buenos Aires, Argentina
User avatar
TecniSoftware
 
Posts: 235
Joined: Fri Oct 28, 2005 6:29 pm
Location: Quilmes, Buenos Aires, Argentina

Re: Seek a record

Postby Silvio » Fri May 08, 2009 10:15 pm

thanks
now run but then not refresh the listbox
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 5 guests

cron