SelectInfo.ActiveTable := BookData.adoqBookDoc;
With SelectInfo.ActiveTable do
    begin
      l_string := TStringList.Create;
      GetFieldNames(l_string);
      if l_string.IndexOf('content') = -1 then
        ShowMessage('l_string.Strings[i]');       //在这没有错,说明有这个字段
      if FieldByName('Content').IsNull then Exit; //在这报错 
  错误提示:adoqBookDoc:Field 'Content' not found  不明白,为什么?上面检测是有这个字段,有为什么还报这样的错

解决方案 »

  1.   

          if l_string.IndexOf('content') = -1 then 
            ShowMessage('l_string.Strings[i]');      //在这没有错,并不一定说明有这个字段
      

  2.   

    如果存在这个字段,l_string.IndexOf('content')的值应该是大于等于0的
      

  3.   

     l_string.IndexOf('content') = -1 说明这个字段不在 l_string中,在其他方面找找原因吧