Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ADO Master-detail query problem

Posted on 2004-03-24
5
Medium Priority
?
861 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 200 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Loops Section Overview
Suggested Courses

927 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