ADO Master-detail query problem

Posted on 2004-03-24
Last Modified: 2013-11-23
I'm trying to create a form with master-detail relationship using ADO Query.

In master query I have the following SQL code:

In the details query i have
SELECT * FROM ItemDetails
WHERE ItemCode=:ItemCode

I have set the datasource of the details query to the TDataSource of the master query.
When I try to run the details query I get the following error:

"Parameter object is improperly defined. Inconsistent or incomplete information was provided."

Can anyone help me with this?

Btw. I'm using Access Database.


Question by:cP6uH
  • 3
  • 2
LVL 27

Expert Comment

ID: 10667457
your parameter


should have the same name as the join field of your mastertable, just with a : before

additional you can define the param- and datatype

meikl ;-)

Author Comment

ID: 10667615

My join filed of the master table is the same

Master Query:
SELECT ItemCode FROM Items

Details Query:
SELECT ItemCode FROM ItemDetails
WHERE ItemCode=:ItemCode

The weird thing is that this works with BDE, but it doesn't with ADO.
LVL 27

Accepted Solution

kretzschmar earned 50 total points
ID: 10667689
it should also work with ado in the same way
(i've done myself this often)

well, open the params-property of your child-query,
and adjust there the param- and data-type property

paramtype -> ptInput
datatype -> ftInteger (i guess)

meikl ;-)

Author Comment

ID: 10667744
Changing the datatype to string worked. It was unknown before.

Thanks a lot!!

LVL 27

Expert Comment

ID: 10667760
was not sure about the datatype
u used for itemcode :-))

glad u got it sorted

meikl ;-)

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 100
FMX and jaudiotracker playing memory stream 29 78
Dynamically Created Query 3 55
Multi-layered image in FireMonkey 9 34
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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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