parameter-query in VB

parameter-query in VB

Post by Nicolas Kauffma » Tue, 13 Jun 1995 04:00:00

If I write:

  Set qdCHILD = dbDatabase.OpenQueryDef("QueryCHILD")

  qdCHILD!Param1 = dyPARENT!Field_A  'Dynaset on PARENT already exists
  qdCHILD!Param2 = dyPARENT!Field_B

  Set dyCHILD = qdCHILD.CreateDynaset()
  MsgBox "# rows in dyCHILD depending on PARENT: " & dyCHILD.RecordCount

... it works! I get different correct counts.
But coding the following two lines creates an error:

  dtaCHILD.RecordSource = qdCHILD    'Data-control binding to QueryDef
  'VB-Error: "2 parameters were expected but only 0 were supplied"

b rgds
Nicolas Kauffmann


1. Passing Parameters to stored parameter queries using VB 5's Data Controls


I have a Data control in a VB5 program to manage the main table (Businesses)
and then i'd like to use a data control with a subquery to show all the
contacts for that business. The way im doing it right now is changing the
.recordsource property of the subquery data control every time the main data
control is repositioned.

Is there a way to use stored parameter queries in an Access database,
instead of having to type the SQL in the .recordsource property?

Thank you in advance,

    Nuno Ferreira

2. Data entry screens using foxpro

3. Opening Access 7.0 parameter query in VB 5.0

4. Logs files in a database application

5. Calling parameter queries from VB 5.0 using RDO 2.0

6. Two questions for experts

7. parameter-query in VB

8. Delphi & Sybase experiences ?

9. Stored Parameter Queries and VB

10. Access 97 Parameter Queries and VB Data Reports

11. Call An Access Parameter Query From VB App?

12. ********** SQL Parameter queries in VB ***********