Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 863
  • Last Modified:

ADO Master-detail query problem

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
cP6uH
Asked:
cP6uH
  • 3
  • 2
1 Solution
 
kretzschmarCommented:
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
 
cP6uHIT ManagerAuthor Commented:
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
 
kretzschmarCommented:
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
 
cP6uHIT ManagerAuthor Commented:
Changing the datatype to string worked. It was unknown before.

Thanks a lot!!

Dragan
0
 
kretzschmarCommented:
well,
was not sure about the datatype
u used for itemcode :-))

glad u got it sorted

meikl ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now