Link to home
Start Free TrialLog in
Avatar of kiranmahale
kiranmahale

asked on

ADO recordset problem

Previously I was looping thru TADOQuery object. I changed the code which now loops thru TADOQuery.recordset But now I have problem while passing the field into existing procedure

//// ----- Previous Code (which works fine)

Procedure ReadRecord(Fld : TField)

qr := TADOQuery.create(nil);
qr.sql.text := 'select * from table1'

with qr do
  while not eof
  begin
     ReadRecord(qr.fields[0]) ;
     Next ;
  end ;

//// ----- Latest Code

Procedure ReadRecord(Fld : TField)

qr := TADOQuery.create(nil);
qr.sql.text := 'select * from table1'

rs := qr.recordset ; {where as rs is type _Recordset}
with rs do
  while not eof
  begin
     ReadRecord(rs.fields[0]) ; //compile error here
     MoveNext ;
  end ;

I get compile error in readrecord line. I tried to typecast as Tfield but I got access violation. Pls help me to solve this problem

Thx in advance.

-Kiran
ASKER CERTIFIED SOLUTION
Avatar of Epsylon
Epsylon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kiranmahale
kiranmahale

ASKER

I don't want to change the procedure at all. Instead of that if u any other solutions I will accept.
There is no other solution......
kiranmahale,
No comment has been added lately (815 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to Epsylon http:#6165691

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

DragonSlayer
EE Cleanup Volunteer