DELPHI登录窗体运行时一直提示列名无效

来源:百度知道 编辑:UC知道 时间:2024/04/29 05:49:49
登录窗体通过SQL语句对USERM表查询userid和password,代码并没有错误,可运行时一直提示
Debugger Exception Notification
Project fuzhang.exe raised exception class EOLeException with message'列名'001'无效。'. process stopped.use Step or run to continue.怎么办啊,哪位高手帮帮忙啊,急救!!!
我在数据库userm表中设有userid=001,password=001
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if edit1.Text ='' then
begin
messagebox(handle,'用户ID不能为空!','信息',mb_ok);
edit1.SetFocus;
exit;
end else
begin
if edit2.Text ='' then
begin
messagebox(handle,'密码不能为空!','信息',mb_ok);
edit2.SetFocus;
exit;
end else
begin
if (edit1.Text<>'')and (edit2.Text<>'')then
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select userid,p

可以把你的代码贴出来看看啊`
或者重新开启你的DLPHI看看

补充:
我有点看不太明白你的程序:
在过程的最后,为什麼会加了 ' CLOSE' ?
还有你的 BEGIN..END用的太冗余了.
如果ELSE等后只有一句代码的话,不需要begin...end ,看著好难受啊``

将所有的edit1.text 和 edit2.text 都换成 trim(edit1.text ) 和trim(edit2.text ) 即可 ; 加上trim()是为了去掉前后的空格