We help IT Professionals succeed at work.

ADO Master-detail query problem

Simon
Simon asked
on
Medium Priority
876 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




Comment
Watch Question

Top Expert 2004

Commented:
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 ;-)
SimonIT Manager

Author

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.
Top Expert 2004
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
SimonIT Manager

Author

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

Thanks a lot!!

Dragan
Top Expert 2004

Commented:
well,
was not sure about the datatype
u used for itemcode :-))

glad u got it sorted

meikl ;-)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.