procedure TForm1.Button1Click(Sender: TObject);
begin
if Edit1.Text='' then
     ShowMessage('No Input')
else
    begin
        Query1.SQL.Clear;
        Query1.SQL.Add('select CustNo,Company,City,State from customer.db');
        Query1.SQL.Add('where country=(:countryName)');
        Query1.Params[0].AsString:=Edit1.Text;
        Query1.ExecSQL;
        Query1.Active:=True;
        Edit1.Text:='';
    end
end.
[Error] Unit1.pas(45): ';' expected but '.' found
[Error] Unit1.pas(47): Declaration expected but end of file found
[Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    if Edit1.Text='' then
         ShowMessage('No Input')
    else
        begin
            Query1.SQL.Clear;
            Query1.SQL.Add('select CustNo,Company,City,State from customer.db');
            Query1.SQL.Add('where country=(:countryName)');
            Query1.Params[0].AsString:=Edit1.Text;
            Query1.ExecSQL;
            Query1.Active:=True;
            Edit1.Text:='';
        end;<----这个分号老兄搞没了
    end.
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    if Edit1.Text='' then
         ShowMessage('No Input')
    else
        begin
            Query1.SQL.Clear;
            Query1.SQL.Add('select CustNo,Company,City,State from customer.db');
            Query1.SQL.Add('where country=(:countryName)');
            Query1.Params[0].AsString:=Edit1.Text;
            Query1.ExecSQL;
            Query1.Active:=True;
            Edit1.Text:='';
        end
    end.——————————end;
      

  3.   

    哈哈,一般
    [Error] Unit1.pas(45): ';' expected but '.' found
    [Error] Unit1.pas(47): Declaration expected but end of file found
    [Fatal Error] Project2.dpr(5): Could not compile used unit 'Unit1.pas'
    都是逗号惹的祸
    问题mrfanghansheng(☆☆☆木鱼☆☆☆) 已经说了我就不多此一举