使用了ADOCONNECTION把?
将他的PROMPT设置成FALSE就可以了

解决方案 »

  1.   

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    messagebox(application.Handle ,'hello','hello',2);
    end;
      

  2.   

    我用Delphi中的Password Dialog,我想在主窗体未显示之前先弹出密码输入框,如果正确再显示主窗口,怎么做?
      

  3.   

    program Project1;uses
      Forms,
      Unit1 in 'Unit1.pas' {Form1},
      Unit2 in 'Unit2.pas' {Form2};{$R *.RES}begin
      Application.Initialize;
      form2:=Tform2.create(application);
      form2.showmodal;
      if form2.edit2.text<>''  then
      application.Terminate
      Application.CreateForm(TForm1, Form1);
      Application.Run;
    end.
    //老大,给分
      

  4.   

    你的意思就是form1是一个窗体,是主窗体;
    form2是一个密码窗体,对不对?
      

  5.   

    TO ihihonline(小小):
       对,就这意思。
      

  6.   

    uses
      Forms,
      Main in 'Main.pas' {Form1};{$R *.res}begin
      Application.Initialize;
      application.ShowMainForm:=false;
      Application.CreateForm(TForm1, Form1);
      Application.Run;
    end.
    ////////////////////
    //main.pas
    /////////////
    procedure TForm1.FormCreate(Sender: TObject);
    var
    pas:string;
    begin
    if inputquery(application.Title,'Please Input Password:',pas) then
    begin
      if 'your password'<>pas then
      begin
        application.Terminate;
      end
      else
      begin
        application.ShowMainForm:=true;
      end;
    end
    else
    begin
      application.Terminate;
    end;
    end;
      

  7.   

    查看你的工程文件(DPR)
    窗体建立的顺序为FORM1、2、3……把LOGINFORM窗体从你的AUTO-CREATE FORMS中移至AVAILABLE FOMS(在PROJECT OPTIONS中设置)。在工程文件中修改:
    原文件:
    program Project1;uses
      Forms,
      Unit1 in 'Unit1.pas' {Form1},
      Unit2 in 'Unit2.pas' {Form2};{$R *.res}begin
      Application.Initialize;
      Application.CreateForm(TForm1, Form1);
      Application.CreateForm(TForm2, Form2);
      Application.Run;
    end.修改后:begin
       LOGINFORM:=TLOGINFORM。CREATE(APPLIACTION);
       loginform.showmodal;
         if loginform.modalresult = 1 then 
         
         begin
           Application.Initialize;
           Application.CreateForm(TForm1, Form1);
           Application.CreateForm(TForm2, Form2);
           Application.Run;
         end;
    end.
    在LOGINFORM中处理密码验证:   IF 正确 THEN 
          modalresult :=mrok
       else
          application.terminate;
       end;同时还要初始化验证失败次数。Password Dialog ???
    通常你要从数据库中取记录验证的。LOGINFORM要联接数据库的。
      

  8.   

    uses 
    Forms, 
    Unit1 in 'Unit1.pas' {Form1}, 
    Unit2 in 'Unit2.pas' {Form2}; 
    这不对吧!应该是在Form1中的uses 加上 unit2;应该是在Form2中的uses 加上 unit1;
      

  9.   


    TO
      vickly(Delphi新手)
    如果用我的去做的话,下边的都不要;  
    uses 
    Forms, 
    Unit1 in 'Unit1.pas' {Form1}, 
    Unit2 in 'Unit2.pas' {Form2}; 
    这不对吧! 应该是在Form1中的uses 加上 unit2;应该是在Form2中的uses 加上 unit1; 
      

  10.   

    stanely(邢儿的劳工) :
    application.Terminate;
    是什么意思? 
      

  11.   

    Application.Terminate就是结束程序.
    你看看在线帮助丫.
      

  12.   

    Application.Terminage就是结束当前的程序,释放所有资源正常退出.
    多看看帮助!
      

  13.   

    InputBox能不能限制它的窗口?
      

  14.   

    在主窗体的create函数中加入密码窗口.show,如果密码输入错误,则运行application.Terminage,结束程序。
      

  15.   

    stanely(邢儿的劳工) :
    用InputQuery不能让输入框显示******,我输入的是密码啊!怎么办呢?
      

  16.   

    program Initialize;
    uses
    forms,dialogs,controls,
    mainFotm in 'MainForm.pas';
    {$R *.RES}
    var
      Password: String;
    begin
      if InputQuery('Password', 'Enter your password', Password) the
         if Password ='d5dg' then
        begin
         //其他操作
         Application.createForm(TMainForm,MainForm);
    Application.run;
    end
    else
    MessageDlg('incorrect password, terminating program', mtError,[mbok],0);
    end.
      

  17.   

    要让InputQuery显示******?????????
      

  18.   

    修改DPR文件:
    begin
      Form2:=TForm2.Create(Application);
      Form2.ShowModal;
      if Form2.str='1' then
      begin
        Application.Initialize;
        Application.CreateForm(TForm1, Form1);
        Application.Run;
      end;
    end.
    具体处理密码的验证则放在Form2中处理
      

  19.   

    大哥,你再看一看可不可以?
    第一步:
    program Project1; uses 
    Forms, 
    Unit1 in 'Unit1.pas' {Form1}, 
    Unit2 in 'Unit2.pas' {Form2}; {$R *.RES} begin 
    Application.Initialize; 
    form2:=Tform2.create(application); 
    form2.showmodal; 
    if form2.v=false then 
    application.Terminate 
    Application.CreateForm(TForm1, Form1); 
    Application.Run; 
    end. 
    Unit Unit2//form2
    interface
    ...
    ...
    var
      form2:Tform2;
      v:boolean;
    ....
    procedure form2.formcreate(sender:Tobject);
    begin
    v:=false;
    end;
    procedure form2.button1click(sender:Tobject);
    begin
    query1.close;
    query1.sql.clear;
    query1.sql.add('select user,pas from T_mm')//用户信息从库里取,例子;
    if query1.locate('user',edit1.text) then
     if edit2.text=query1.field.asstring('pas').asstring;
      then v:=true else
      v:=false;
    end;//当用户信息输入的不对时,v:=false;可以再program里进行判断
    大哥,我给你说
    form2是用来读取用户输入的对不对,如果不对的话,应用程序结束;
    如果用户输入的对的话,则可以进去;
    就是上边的;