Solved

ADO Master-detail query problem

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

In master query I have the following SQL code:
SELECT * FROM Items

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.

Thanks,
Dragan




0
Comment
Question by:cP6uH
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10667457
your parameter

:ItemCode

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 ;-)
0
 

Author Comment

by:cP6uH
ID: 10667615
Meikl,

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.
0
 
LVL 27

Accepted Solution

by:
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 ;-)
0
 

Author Comment

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

Thanks a lot!!

Dragan
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10667760
well,
was not sure about the datatype
u used for itemcode :-))

glad u got it sorted

meikl ;-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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