?
Solved

ADO recordset problem

Posted on 2001-06-07
4
Medium Priority
?
531 Views
Last Modified: 2011-09-20
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
0
Comment
Question by:kiranmahale
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 6165691
The problem is that the types are different. ADO does not know TField.

Try the following:
First put ADOInt in the uses clause. Second change the parameter type of ReadRecord from

Procedure ReadRecord(Fld : TField)

to

Procedure ReadRecord(Fld : Field)


But I don't think this is what you want.
0
 
LVL 1

Author Comment

by:kiranmahale
ID: 6177305
I don't want to change the procedure at all. Instead of that if u any other solutions I will accept.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6177945
There is no other solution......
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 9285698
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
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question