HELP with Parameter queries and Data Control 
Author Message
 HELP with Parameter queries and Data Control

Hi!

        I've a problem with parameters queries with data control.
Here it is:

The query: "Ordenar Por"
PARAMETERS [ParamOrden] TEXT;
SELECT * FROM [Tabla Datos Pacientes] ORDER BY [ParamOrden] ASC;

There is a data control named dataexamenes, so what I want to do is to Run
the query and make that the dataexamenes points to the resulted records.
The parameter of the query depends of an array of buttons.

So;

Dim tmpquery as QueryDef
Set tmpQuery = DataExamenes.Database.QueryDefs("Ordenar Por")
    Case 0
        tmpQuery.Parameters("ParamOrden") = CampoNombre$
        Set tmpRs = tmpQuery.OpenRecordset(dbOpenDynaset)
    Case 1
        tmpQuery.Parameters("ParamOrden") = CampoApPaterno$
        Set tmpRs = tmpQuery.OpenRecordset(dbOpenDynaset)
    End Select

    Set DataExamenes.Recordset = tmpRs

But it doesn't work... :(

        Any ideas?
                Thanks!
                                Juan Ignacio S.



Sat, 06 Feb 1999 03:00:00 GMT  
 HELP with Parameter queries and Data Control



Quote:

>Hi!

>    I've a problem with parameters queries with data control.
>Here it is:

>The query: "Ordenar Por"
>PARAMETERS [ParamOrden] TEXT;
>SELECT * FROM [Tabla Datos Pacientes] ORDER BY [ParamOrden] ASC;

>There is a data control named dataexamenes, so what I want to do is to Run
>the query and make that the dataexamenes points to the resulted records.
>The parameter of the query depends of an array of buttons.

>So;

>Dim tmpquery as QueryDef
>Set tmpQuery = DataExamenes.Database.QueryDefs("Ordenar Por")
>    Case 0
>        tmpQuery.Parameters("ParamOrden") = CampoNombre$
>        Set tmpRs = tmpQuery.OpenRecordset(dbOpenDynaset)
>    Case 1
>        tmpQuery.Parameters("ParamOrden") = CampoApPaterno$
>        Set tmpRs = tmpQuery.OpenRecordset(dbOpenDynaset)
>    End Select

>    Set DataExamenes.Recordset = tmpRs

>But it doesn't work... :(

>    Any ideas?

Juan. Sorry, but I think you're in the wrong NewsGroup. Whatever language the
above code is, it doesn't appear to be Visual dBASE, which is what this
NewsGroup covers.

AAK [TeamB]



Sat, 06 Feb 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. Help! Parameter Query via Data Control

3. Parameter query for Bound Data Control

4. VB4: Parameter query&Data Control?

5. Parameter Queries and Data Controls

6. Using Parameter Queries and Data Controls

7. Parameter Queries and Data controls

8. Data Control and Query Parameters Question

9. Parameter Queries in a VB data control

10. How to bind Parameter Query to Data Control ?

11. Executing Access queries with Data Control and parameter passing

12. Data Control and parameter query

 

 
Powered by phpBB® Forum Software