各位:
我做了一个登陆窗口,及软件是一个网络版的,初始化登陆窗口读取本地配置数据库IP地址,结果问题就出现了,我在编译的时候正常及程序运行正常,编译后程序在我编译程序的机上能正常运行,但转到用户端后程序根本没法运行,我观察应用程序的进程发现这个程序的进程地运行十几秒后就自动退出来了,我不知道这是为什么,是什么原因引起的,还请知道的老兄告知小弟一声,谢谢!!

解决方案 »

  1.   

    procedure TuserLogin.Button3Click(Sender: TObject);
    var tini: tinifile;
        sername: string;
    begin
    if Connection = 'no' then
    begin
       application.MessageBox('Á¬½Ó·þÎñÆ÷ʧ°Ü,ÇëÏÈÁ¬½Óµ½¿ÉÓõķþÎñÆ÷!','´íÎóÐÅÏ¢',MB_ICONERROR);
       exit;
    end;   tini := tinifile.Create(extractfilepath(application.ExeName) + '\ConnectionServer.Ini');
       sername := tini.ReadString('Êý¾Ý¿â','·þÎñÆ÷Ãû','%!');
       dm.ADOConnection1.Connected := false;
       dm.ADOConnection1.ConnectionString := 'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=productSystem;Data Source=' + sername;
        dm2.ADOConnection1.Connected := false;
         dm2.ADOConnection1.ConnectionString := 'Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=productSystem;Data Source=' + sername;
       try
        dm.ADOConnection1.Connected := true;
        dm2.ADOConnection1.Connected := true;
       except
          dm.ADOConnection1.Connected := false;
         Connection := 'no';
          application.MessageBox('Á¬½Ó·þÎñÆ÷ʧ°Ü,ÇëÏÈÁ¬½Óµ½¿ÉÓõķþÎñÆ÷!','´íÎóÐÅÏ¢',MB_ICONERROR);
       end;
    with dm.AdoQuery1 do
    begin
    close;
    sql.clear;
    sql.Add('select * from Users where loginId=:loginuser and loginPassword=:loginpassword');
    parameters.paramByName('loginUser').value:=edit1.Text;
    parameters.paramByName('loginPassword').value:=edit2.Text;
    open;
    end;
    if dm.AdoQuery1.RecordCount>0 then
    beginif form1=nil then form1 := Tform1.Create(nil);
    form1.Show;
    userLogin.Hide ;
    end
    else
    begin
    Application.MessageBox('µÇ½Óû§Ãû»òÃÜÂë´íÎó,ÇëÈ·ÈÏÄúµÄÊäÈëÊÇ·ñÓÐÎó!','Óû§ÃûÃÜÂë´íÎó');
    edit1.SetFocus;
    end;这个是我登陆按钮源文件,谁能告诉我C/S到底是怎么做了,我做成单机版是可以的但做成网络版就不行了,是不是我忘记了什么?