请教:FROM子句错误,谢谢
delphi7 + access
登陆测试的例子
运行时总是提示如题的错误。
以下登陆按钮的处理函数,请帮忙看看。
procedure TForm1.Button1Click(Sender: TObject);
begin
Inc(Logined_times);//已登陆次数累加
if(Logined_times > Max_times) then//登陆次数检测
begin
ShowMessage('已登陆次数超过足大登陆次数,请重新打开程序');
Application.Terminate;
end;
if(
(length(trim(Edit1.Text)) > 0)
or
(length(trim(Edit2.Text)) > 0)
) then
begin
Lsj_Sql:='select * from user where user_name='''+ trim(Edit1.Text)+''' and pass_word='''+trim(Edit2.Text)+''' ';
ShowMessage('[test] Lsj_Sql:'+Lsj_Sql);
ADOQuery1.close;
ADOQuery1.sql.Clear;
ADOQuery1.sql.add(Lsj_Sql);
ADOQuery1.open;
if(ADOQuery1.recordcount > 0) then
begin
ShowMessage('合法用户');
end
else
begin
ShowMessage('非法用户');
end
end;
end;
end.