procedure LoadGridColumn(strUser,strTableName:string);
   var
      qrytemp:Tadoquery;
      inti:Integer;
   begin
      qrytemp:=tadoquery.Create(nil);
      try
         DBGrid.Selected.Clear;
         qrytemp.Connection:=DataForm.ADOConn;
         qrytemp.SQL.Clear;
         qrytemp.SQL.Add('select * from PubDBGridStyle where PubLoginUser='''+strUser+''' and PubTableName='''+strTableName+'''');
         qrytemp.Open;
         qrytemp.First;
         for inti:=0 to qrytemp.RecordCount-1 do
            begin
               DBGrid.Selected.Add(qrytemp.FieldByName('PubKeyName').AsString+#9+
                                   qrytemp.FieldByName('PubDisWidth').AsString+#9+
                                   qrytemp.FieldByName('PubDisName').AsString);
               qrytemp.Next;
            end;
         DBGrid.ApplySelected;
      finally
         qrytemp.Free;
      end;
   end;我写了一个LoadGridColumn用来把WWDBGRID的来设置列宽和列标题显示,但是如果我按钮点的快了,就会出错
出错内容
list index out of bound(2)