TOracleDataSet's calculate Filed problem

mazhigang

Member
I want to show the record index in my DbGrid,so I create a calculated field 'RecNo', in the OnCalcFields event is the code:
with DataSet do
FieldByName('RecNo').AsInteger := RecNo;
when the code execute, I get a lot of duplicate row in the grid. Have any other way to show the record index? and How?
my oracle: oracle 816 for windows;
doa version: for delphi5 3.4.3
thank you
 
I'm not sure if you can reference RecNo in the OnCalcFields event. However, you can simply include the rownum pseudo column in your query, for example:

select e.*, rownum recno
from emp e
order by e.empno

------------------
Marco Kalter
Allround Automations
 
Back
Top