Page 1 of 1

seek and string searching

Posted: Fri Apr 14, 2006 10:58 pm
by Ehab Samir Aziz
I can not find seek works probably with strings !!

Code: Select all

   if MsgGet( "Search", "Customer Appreviation", @V_CU_appr,;
              "..\bitmaps\lupa.bmp" )
      select 1
      use cust
      set index to cust10
      if ! DbSeek( alltrim(upper(V_CU_Appr )))
         MsgAlert( "I don't find that customer" )
         GO nRecNo
      else
         oLbx:UpStable()           // Corrects same page stabilizing Bug
         oLbx:Refresh()            // Repaint the ListBox
      endif
   endif


Re: seek and string searching

Posted: Thu Apr 20, 2006 6:39 pm
by E. Bartzokas
Ehab Samir Aziz wrote:I can not find seek works probably with strings !!

Code: Select all

   if MsgGet( "Search", "Customer Appreviation", @V_CU_appr,;
              "..\bitmaps\lupa.bmp" )
      select 1
      use cust
      set index to cust10
      if ! DbSeek( alltrim(upper(V_CU_Appr )))
         MsgAlert( "I don't find that customer" )
         GO nRecNo
      else
         oLbx:UpStable()           // Corrects same page stabilizing Bug
         oLbx:Refresh()            // Repaint the ListBox
      endif
   endif

My best guess is that you are searching for a string using an index which is of some different key value.

You may try to insert a line for debugging, for example:
MSGINFO(IndexKey()) right after the line set index to cust10
and see if the primary key of the index is of how you want it to be.
(In my opinion, the primary key must be the Customer Code, and your current index is probably based on the Customer Name).

Please let me know if you solved your problem.

Kind regards
Evans Bartzokas

Posted: Sat Apr 22, 2006 8:39 am
by Ehab Samir Aziz
Problem did not solved . I do not know ?
The function you suggessted gave the apropraite key.

Code: Select all

      select 1
      use cust
      set index to cust10
      MSGINFO(IndexKey()) 
      if ! DbSeek( alltrim(upper(V_CU_Appr )))
         MsgAlert( "I don't find that customer" )
         GO nRecNo
      else
         oLbx:UpStable()           // Corrects same page stabilizing Bug
         oLbx:Refresh()            // Repaint the ListBox
      endif
   endif