try ADOTable1.Active:=true; ADOTable1.Filter:='USER="'+edit1.text+'"'; ADOTable1.Filtered:=true; ADOTable1.Open; Except application.Messagebox('请与系统管理员联系.','数据连接错误!',MB_OK); application.Terminate; end; if ADOTable1.RecordCount=1 then begin if ADOTable1['pass']=edit2.Text then begin if ADOTable1['popedom']='1' then begin form1.Hide; end else application.Messagebox('用户权限错误','权限错',MB_OK); end else application.Messagebox('用户密码错误','pass错',MB_OK); end else application.Messagebox('用户名错误','user错',MB_OK); end;