别名可以直接用路径来写;
  Try
    if Application.MainForm.MDIChildCount>0 then
      ActiveMDIChild.Close;
  Finally
    TmyFormChild.Create(Self);
  End;

解决方案 »

  1.   

    1.不设置别名编程会很累的,尤其是你要用TQuery控件的时候。
    BDE的发布不是很难,搜索以前的帖子,一定可以找到方法。2.if Assigned(ChildForm) then Exit;
      

  2.   

    procedure NewMDIChild(AFormClass: TFormClass);
    var
      vForm: TForm;  function SearchMDIChild(AFormClass: TFormClass): TForm;
      var
        iCount: Integer;
      begin
        for iCount := 0 to Screen.FormCount - 1 do
        begin
          Result := Screen.Forms[iCount];
          if (Result.ClassType = AFormClass) and(Result.FormStyle = fsMDIChild) then
            Exit;
        end;
        Result := nil;
      end;begin
      vForm := SearchMDIChild(AFormClass);
      if not Assigned(vForm) then
        AFormClass.Create(Application)
      else begin
        if vForm.WindowState = wsMinimized then
          vForm.WindowState := wsNormal;
        vForm.BringToFront;
      end;
    end;调用这个过程传个窗口类
      

  3.   

    设置好DataBase1的Driver name为STANDARD, name为MyBase
    Query1.DataBaseName为MyBase
    然后
    程序里
      DataBase1.Params.Add('PATH=' + ExtractFilePath(ParamStr(0)));
      DataBase1.Open;
      Query1.Open;