How To Extract The Data From ADOTable Feild?

Posted on 2009-12-26
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?
Question by:jsmitter
    LVL 22

    Accepted Solution

    something like this:

    i: Integer;
    FieldName, FieldValue: String;
    for i := 0 to AdoTable1.FieldsCount-1 do
          FieldName := AdoTable1.Fields[i].FieldName;
          FieldValue := AdoTable1.Fields[i].AsString
          //printout or do whatever you want
    LVL 2

    Assisted Solution

    ... := AdoTable1.FieldByName('...').AsInteger(AsString, AsFloat, AsCurrency, ...);

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


    Author Closing Comment

    Thank you!

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now