[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How To Extract The Data From ADOTable Feild?

Posted on 2009-12-26
3
Medium Priority
?
347 Views
Last Modified: 2013-11-23
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;
0
Comment
Question by:jsmitter
3 Comments
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 1000 total points
ID: 26126672
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
 
LVL 2

Assisted Solution

by:ASta
ASta earned 1000 total points
ID: 26126926
... := 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
 

Author Closing Comment

by:jsmitter
ID: 31670141
Thank you!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

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…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month17 days, 18 hours left to enroll

830 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