• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 669
  • Last Modified:

Can't find TSearchBox / TSearchItem / SearchComponent.dcu | Anyone know this component?

Hi guys

I'm trying to get an old project to compile but it says class "TSearchBox" not found.
The missing unit is "SearchComponent" and it's looking for SearchComponent.dcu

I have googled / binged / AOL'd / Ask.com'd / pudn'd  torry.net'd etc
..and I can't seem to find this.

Hopefully you can help.

Here's references in the unit that might help:

unit U_CommissionsManagement;

interface

uses
  .. SearchComponent;

type
  TCommissionsManagement = class(TForm)
    ..
    SearchBox1: TSearchBox;
    ..
    siFrom: TSearchItem;
    siFormula: TSearchItem;
    siAgent: TSearchItem;
    siTo: TSearchItem;
    procedure SearchBox1Click(Sender: TObject);
    ..
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}

procedure TCommissionsManagement.SearchBox1Click(Sender: TObject);
begin
  Q_Search.Close;
  SearchBox1.SQL.Text := 'SELECT COMMISSIONS.*,';
  SearchBox1.SQL.Append('COMMISSION_AGENTS.AGENT_NAME,');
  SearchBox1.SQL.Append('COMMISSION_FORMULAS.FORMULA_NAME');
  SearchBox1.SQL.Append('FROM ');
  SearchBox1.SQL.Append('COMMISSION_FORMULAS, COMMISSIONS, COMMISSION_AGENTS');
  SearchBox1.SQL.Append('WHERE ');
  SearchBox1.SQL.Append('COMMISSION_FORMULAS.COM_FORM_ID = COMMISSIONS.COM_FORM_ID AND');
  SearchBox1.SQL.Append('COMMISSIONS.AGENT_ID = COMMISSION_AGENTS.AGENT_ID');

  Q_Search.SQL.Text := SearchBox1.GenResultSQL;

  if siFrom.Value <> null then
  begin
    Q_Search.Parameters.ParamByName('siFrom').DataType := ftDate;
    Q_Search.Parameters.ParamByName('siFrom').Value := Floor(siFrom.Value);
  end;

  if siTo.Value <> null then
  begin
    Q_Search.Parameters.ParamByName('siTo').DataType := ftDate;
    Q_Search.Parameters.ParamByName('siTo').Value := Floor(siTo.Value) + 1;
  end;

  if siAgent.Value <> null then
  begin
    Q_Search.Parameters.ParamByName('siAgent').DataType := ftInteger;
    Q_Search.Parameters.ParamByName('siAgent').Value := siAgent.Value;
  end;

  if siFormula.Value <> null then
  begin
    Q_Search.Parameters.ParamByName('siFormula').DataType := ftInteger;
    Q_Search.Parameters.ParamByName('siFormula').Value := siFormula.Value;
  end;

  Q_Search.Open;
end;

procedure TCommissionsManagement.Q_SearchAfterScroll(DataSet: TDataSet);
begin
  if Q_Search.FieldByName('Commission_ID').AsString <> '' then
  begin
    lblEditCommissionStructure.Enabled := True;
    lblDeleteCommissionStructure.Enabled := True;
  end
  else
  begin
    lblEditCommissionStructure.Enabled := False;
    lblDeleteCommissionStructure.Enabled := False;
  end;
end;

..

procedure TCommissionsManagement.FormShow(Sender: TObject);
begin
  TranslateForm(Self);
  SiFrom.DisplayCaption := Translate(ApplicationLanguage, Self.Name, 'SearchFrom', 'From');
  SiTo.DisplayCaption := Translate(ApplicationLanguage, Self.Name, 'SearchTo', 'To');
  SiAgent.DisplayCaption := Translate(ApplicationLanguage, Self.Name, 'SearchAgent', 'Agent');
  SiFormula.DisplayCaption := Translate(ApplicationLanguage, Self.Name, 'SearchFormula', 'Formula');
  SearchBox1.ButtonCaption := Translate(ApplicationLanguage, Self.Name, 'SearchSearchButton', 'Search');
end;

end.

Open in new window

0
rfwoolf
Asked:
rfwoolf
2 Solutions
 
Emmanuel PASQUIERFreelance Project ManagerCommented:
no, no luck neither with Delphi Super Page
http://dsp.href.com/

I think you have tried all the other good sites to look for delphi components.

It does not seem to be overly useful , if I understand the purpose of this SearchBox :
Create a SQL Query for Q_Search based on a request already written , just adding some search fields ?

Well, you have to set the parameters yourself , the request is most probably always the same (maybe some checkbox can make some search fields optional but that's not a big deal) . So I recommend recreating your user interface using standard DB fields and components, writing the complete Q_Search.SQL formula. You will loose less time doing that instead of trying to find this TSearchBox (if ever you find it), and have much less problems with different Delphi versions
0
 
calinutzCommented:
It is probably a custom made component.
Try to replace it's functionality. I mean, try to make your own component that would make the same things that the search box does. And then replace the component on the forms.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now