你的两各个DBGRID使用两个datasource没?

解决方案 »

  1.   

    DBGrid不执行SQL语句呀!TQuery才执行语句呢。你用了几个TQuery?
      

  2.   

    以上的问题我搞定了,现在我想问一下大家,我在ActiveForm中有一个函数,函数中的一段代码是要动态构造好几个Field(fielda:=Tfield.create(self))....
    但如果我每一次要调用这个函数时,如果不先free,那么就会出错,但我用以下这段代码free也会出错,代码如下:for i:=0 to self.componts-1 do
      if componts[i].classparent.classname='tfield' then
         componts[i].free
      

  3.   

    componts[i].free這句代碼明顯不對.
    在創建時使用
    try
    .
    .
    .
    Free格式了。
      

  4.   

    try
          Session.GetAliasNames(tmpList);
      for I := 0 to tmpList.Count - 1 do
          if LowerCase(tmpList[i])='CostingDB' then
    IsAliasName:=true;      if not IsAliasName then
       Session.AddAlias('CostingDB','MSSQL',CostDB.Params);
    Finally
       tmpList.Free;
    end;