seek and string searching

Post Reply
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

seek and string searching

Post 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

User avatar
E. Bartzokas
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Re: seek and string searching

Post 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
Ehab Samir Aziz
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Post 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
Post Reply