Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8326033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:38:21+00:00 2026-06-09T00:38:21+00:00

I created a table in my database with MYDAC components and added data. How

  • 0

I created a table in my database with MYDAC components and added data. How can i extract these values that in colums from this table?

i tried these but they didn’t work;

 MyQuery1.Close;
 MyQuery1.SQL.Text :='SELECT * FROM uyeler ORDER BY site';
 Listbox1.Items.Add(MyQuery1.ParamByName('site').AsString);
 MyQuery1.Execute; 

uyeler = table

site = colums

Editors Note: Based on comments made to accepted answer, this question is asking how to populate a TListBox with the data returned in a column of a query.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:38:22+00:00Added an answer on June 9, 2026 at 12:38 am

    Your question is a little unclear. You ask how to add column data to a TListBox, but your code sample shows something about ParamByName, which looks like you’re trying to assign a ListBox value to a SQL parameter.

    Note: Question clarified based on comment to this reply. The first code answers the question; I’ll leave the second as an example for future readers because it’s already written.

    If you’re trying to fill a TListBox from a database column, you need to run the query, and then loop through the data to add the column data to your TListBox. (You also shouldn’t SELECT * when you’re only going to use the site column; it means extra data is being sent from the database to the application when the data will never be used and will end up being thrown away.)

    This should help you get started:

    MyQuery1.Close;
    MyQuery1.SQL.Text := 'SELECT site FROM uyeler ORDER BY site';
    try
      MyQuery1.Open;
      ListBox1.Items.Clear;
      while not MyQuery1.Eof do
      begin
        ListBox1.Items.Add(MyQuery1.Fields[0].AsString);
        MyQuery1.Next;
      end;
    finally
      MyQuery1.Close;
    end;
    

    If you’re trying to do the second (populate a parameter with a value from a TListBox), this should help:

    // to shorten typing of long lines
    var
      Site: string;
    begin
      if ListBox1.ItemIndex <> -1 then
      begin
        MyQuery1.Close;
        MyQuery1.SQL.Clear;
        MyQuery1.SQL.Add('SELECT Column1, Column2, site FROM uyeler');
        MyQuery1.SQL.Add('WHERE site = :siteval ORDER BY site');
        Site := ListBox1.Items[ListBox1.ItemIndex];
        MyQuery1.ParamByName('siteval').AsString := Site;
        MyQuery1.Open;
        try
          // Use the database rows here
        finally
          MyQuery1.Close;
        end;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a table in the database that has the data like this: Now
I have a large dynamic table created from database data. I need the column
Let's say I have a dynamically-created table that is filled with data from a
I have created a table on an Oracle 10g database with this structure :
I'm trying to reindex a table in a simple database that I created using
I have created database table. But there is a strange thing I can insert
Is there a query that will show the last created table in a database?
I want to get the last created table name from a MySQL database using
I have created a table in the database that has a System.Guid as it's
I created two (or more) threads to insert data in a table in database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.