请教:FROM子句错误,谢谢

ttl_web 2006-08-20 12:17:47
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.
...全文
121 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
erhan 2006-08-20
  • 打赏
  • 举报
回复
你的表名user是个保留字,换成其他的试试,或者在换成[user]试试
ttl_web 2006-08-20
  • 打赏
  • 举报
回复
谢谢,我改了表名,运行成功。
以后,我将对自建表命名时采用合理的命名方案。

2,498

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧