Locate Method and Partial Key does not Work lazarus / 16-Databases ---------------------------------------------------------------------- goldfish999 · 2015-01-19 20:29 I am using Firebird and Lazarus 1.2.4 and can't get the 'loPartialKey' or 'loCaseInsensitive'  to work. I get the error message 'Identifier no found'. ---------------------------------------------------------------------- howardpc · 2015-01-19 20:51 If you don't show compilable code (and perhaps some typical data) that produces this error, it is hard to know what to suggest that would be constructive. ---------------------------------------------------------------------- goldfish999 · 2015-01-20 05:51 Thanks. This is the code causing the error.  It is in the method of a Button to save a new item into Firebird and to check that it has not been saved before as a slightly different name. ie 'Turnip' and 'Turnips'     if bSeed and bNew then     begin         with DM1.ZTableSeed do         begin          if not Locate('NAME',FrGardenSeeds.EditNewSeedName.Text,[loCa seInsensitive,loPartialKey]) then           begin                 AppendRecord([FrGardenSeeds.EditNewSeedName.Text]);                 ApplyUpdates;                 CommitUpdates;                 Refresh;               bSeed:=False;               bNew:=False;               sSeed:=FrGardenSeeds.EditNewSeedName.Text;               bNew:=True;               bVariety:=True;               FrGardenSeeds.Hide;               FrGardenVariety.PanelVariety.Hide;               FrGardenVariety.PanelEditVariety.Show;               FrGardenVariety.Show;               FrGardenVariety.EditSeed1.Text:=sSeed;               FrGardenVariety.EditNewVariety1.SetFocus;           end           else           begin             ShowMessage('That Seed is Already on Record');                    case QuestionDlg ('Seeds','Do You Want to Enter Another Seed ?',mtCustom,                   [mrYes,'Yes', mrNo,'Enter a Variety',mrAbort,'Abort'],'') of                       mrYes: begin                             FrGardenSeeds.Hide;                             MenuItemAddSeed.Click;                              end;                                           mrNo : begin                             bSeed:=False;                             bVariety:=True;                             FrGardenSeeds.Hide;                             with FrGardenVariety do                             begin                                PanelVariety.Hide;                                PanelEditVariety.Show;                                EditSeed1.Text:=sSeed;                                Show;                                EditNewVariety1.SetFocus;               end;                                                  end;                                           mrAbort : begin                             bSeed:=False;                             bNew:=False;                             FrGardenSeeds.Hide;                                                  end;                                  end;                               end;                         end;             end; ---------------------------------------------------------------------- LacaK · 2015-01-20 07:22 Which DB components do you use ? (sqlDB, Zeos or other) ---------------------------------------------------------------------- goldfish999 · 2015-01-20 10:58 Sorry. Forgot about that. I'm using Zeos. ---------------------------------------------------------------------- miab3 · 2015-01-20 12:31 @goldfish999, Locate works for me in ZEOS 7.2 svn Revision 3605 and Firebird 2.54. http://svn.code.sf.net/p/zeoslib/code-0/branches/testing-7.2/ I checked on the Lazarus 1.2.6 (Win64) and Delphi XE2 (Win32/64). Maybe the point is that loPartialKey works only from the beginning(of the field value). http://zeoslib.sourceforge.net/viewtopic.php?f=40&p=37302&sid=9f89750b 43e64f9b350a433dd5da07fb#p37302 Michal ---------------------------------------------------------------------- rvk · 2015-01-20 14:27 Quote from: goldfish999 on January 19, 2015, 09:29:03 pmI am using Firebird and Lazarus 1.2.4 and can't get the 'loPartialKey' or 'loCaseInsensitive'  to work. I get the error message 'Identifier no found'. "Identifier not found" seems like a compile error to me (and a partial one at that). Can you compile your project or is this indeed a compile error? If it is a compile error could you please specify it completely? (You can right click on the error and select Copy and then Copy selected message to clipboard and paste it here) ---------------------------------------------------------------------- goldfish999 · 2015-01-20 18:55 Ok. this is the error message.  Also the Ctrl+SpaceBar combination does not show the 'loPartialKey' or 'loCaseInsensitive'  result in the code.  unitgarden.pas(1426,85) Error: Identifier not found "loCaseInsensitive" unitgarden.pas(1426,98) Error: Identifier not found "loPartialKey" unitgarden.pas(1593) Fatal: There were 2 errors compiling module, stopping Thanks  Alan ---------------------------------------------------------------------- rvk · 2015-01-20 22:38 Quote from: goldfish999 on January 20, 2015, 07:55:51 pmOk. this is the error message.  Also the Ctrl+SpaceBar combination does not show the 'loPartialKey' or 'loCaseInsensitive'  result in the code.Yeah, that's what i thought. A compile error  loCaseInsensitive and loPartialKey are values of the set TLocateOption located in DB.pas. My guess is that you didn't include DB in your uses clause. When you add DB to your uses clause your program will compile correctly (provided there aren't any other errors). ---------------------------------------------------------------------- goldfish999 · 2015-01-21 04:33 Thanks very much.  That was the problem.  Silly me. All working well now. Im ex Delphi and that used to add DB automatically and I forgot about it.  Tried other stuff but guessed wrong. Once again a million thanks.  Have a great day.   Alan