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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 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

21 Experts available now in Live!

Get 1:1 Help Now