样在表格中显示记录的行序号?

解决方案 »

  1.   

    请参考
    http://expert.csdn.net/Expert/topic/1414/1414972.xml?temp=.6763727
      

  2.   

    在adotable或adoquery中点右键进fields editor,然后点右键选add all fields再new fields,添加一个calclated字段。
    在adoquery1的oncalcfields事件中添加
    ADOquery1.FieldByName('NO').AsInteger:=abs(adoquery1.RecNo);
      

  3.   

    可以在查询中就得到行号:
    oracle:rownum
    db2:rownumber over (orader by...)
      

  4.   

    再DBgrid的OnDrawColumncell事件中写入:
    if column.index=0 then
    dbgrid.canvs.textout(rect.left,rect.top,inttostr(adoquery.recNo));
      

  5.   

    : tyh800220(风林火山) are you guojing??