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 874041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:02:34+00:00 2026-05-15T11:02:34+00:00

i have a ADOQuery1 that is my master table and now i whant to

  • 0

i have a ADOQuery1 that is my master table and now i whant to use onother one ADOQuery2 for my detail Table but realy i don´t find the right way to work out the solucion.

ADOQuery1
nr- Autonum
name
local
quant.
ADOQuery2
Nro _ Autonum
name
l1
l2
l3

can some one help
thank´s

  • 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-05-15T11:02:34+00:00Added an answer on May 15, 2026 at 11:02 am

    For AdoQuery, you should use the DataSource property. Here is what you should do:

    1- Drop an AdoQuery on the form as the master dataset, and write the query using its SQL property.

    2- Drop a DataSource component on the form, and connect it to the master AdoQuery you built in step 1.

    3- Drop another AdoQuery on the form as the detail dataset.

    4- Set DataSource property of your detail dataset to the datasource which is connected to the master dataset (Refer to step 2).

    5- Write the SQL query for your detail
    dataset, using its SQL property; in the query, you should have a WHERE clause which filters your detail dataset using a paramater which has the same name as one of the fields in the master datasource.
    For example, suppose you have an ID field in your master dataset, and a field called MasterID in your detail dataset which is a foreign key for ID field of master dataset. Now to connect the detail dataset to the master one, using these fields, you can write a query for the detail dataset like this:

    SELECT * FROM DetailTable WHERE MasterID = :ID
    

    As you can see, we have a SQL parameter named ID, which has the same name as ID field in master datasource. Now, whenever you browse records in the master datasource, Delphi automatically retrieves the value of ID field, and uses it as the value of ID parameter in the detail dataset, and requeries the detail dataset. You do not need to set the parameter value and requery explicitly. This will be done automatically for you.

    I hope this clarifies things to you about how to make a master-detail relationship using AdoQuery datasets.

    Regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ADOQuery that inserts a record to SQL Server 2005 table that
Have a look at one of my websites: moskah.com The problem is that it
I have a Master/Detail view which opens a popover view via storyboard segue. There
I have sphinx installed for my search engine, and it works great, but now
Have an app that can use tts to read text messages. It can also
Have deployed numerous report parts which reference the same view however one of them
have 2 questions : A computer with 32-bit address uses 2-level page table (9
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in

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.