How To Extract The Data From ADOTable Feild?

I need to pull the records from the fields in an MSAcess dB. I used the "locate"  to set the correct row. I can't figure out how to access any feild on that row. I need to pull the recodrs and build a string and send it to a line printer. Here's what I got so far...

with form1.ADOTable1 do begin          
    AdoTable1.Locate('ModemID', ModemIDProc,[]);         //Match ModemID To dBase
   What goes here?
end;
jsmitterAsked:
Who is Participating?
 
Ferruccio AccalaiConnect With a Mentor Senior developer, analyst and customer assistance Commented:
something like this:

var
i: Integer;
FieldName, FieldValue: String;
begin
for i := 0 to AdoTable1.FieldsCount-1 do
   begin
      FieldName := AdoTable1.Fields[i].FieldName;
      FieldValue := AdoTable1.Fields[i].AsString
      //printout or do whatever you want
   end;
end;  
0
 
AStaConnect With a Mentor Commented:
... := AdoTable1.FieldByName('...').AsInteger(AsString, AsFloat, AsCurrency, ...);

if AdoTable1.Locate('ModemID', ModemIDProc,[]) then
  ShowMessage(Format('I found, i found: %d', [AdoTable1.FieldByName('ModemID').AsInteger])
else
  ShowMessage('Sorry, boss, I not found :((((');

:)
0
 
jsmitterAuthor Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.