query1.SQL.add('select * from [password] where [用户名]=''' +edit1.text+'''and [密码]='''+ edit2.text+'''');
初步估计是你的表名或字段用到了关键字,应该是你的用户名字段为user吧,两边要加上中括号
所有表名和字段都加上中括号就万无一失了
procedure TForm9.Button1Click(Sender: TObject);
begin
query1.Close;
query1.SQL.Clear;
query1.SQL.add('select * from password where 用户名='+''''+edit1.text+''''+'and 密码='+''''+edit2.text+'''');
query1.Open;
if query1.RecordCount<>0 then
begin
query1.Close;
query1.SQL.Clear;
query1.SQL.add('DELETE from password where 用户名='+''''+edit1.text+''''+'and 密码='+''''+edit2.text+'''');
query1.EXECSQL;
showmessage('删除成功');
end
else
begin
application.MessageBox('密码错误,请重新输入','提示',mb_ok);
edit1.SetFocus;
end;
end;