各位大侠你们好 ,我已经做了一个应用程序界面,想通过输入口令并通过对数据库地查询得到严正的效果,恳请各位大侠帮助,最好有源代码

解决方案 »

  1.   

    搜索以前的帖子吧,use“登录”或者“登陆”
    pick it up urself
      

  2.   

    var
     strsql:string;
    begin
    if 检查你的必要edit中的text=‘’ then
      begin
      showmessage('必要数据不能为空');
      abort; 
      end;
    else
      begin
      strsql:='select 与你必要信息有关的字段名 from 表 where 对应字段=对应edit.text';
      query.sql.clear;
      query.sql.text:=strsql
      query.open;
      if query.eof then
        begin
       showmessage('该用户不存在');
        exit;
        end
      else
        你想要的程序继续执行,我猜你要进入系统界面了;
      query.close;
      end;
    end;
      

  3.   

    var
    s:variant;
    .
    .
    begin
     s:=query1.lookup('name',edit1.text,'password');
     if edit2.text<>s then
     begin
      edit2.text:='';
      showmessage('密码不对');
     end
     else
      showmessage('可以进去了');
    end;
    说明:name为数据表中的用户名,password为数据表中与之对应的密码