Passing variables to query parameters 
Author Message
 Passing variables to query parameters

I have a query command inside a DED that I need to pass 2 variables to.

I have 2 parameters defined in the query as inpSrc and inpMat.

I have tried :

DED.Query(inpSrc , inpMat)  = Src , Mat
----
DED.Query(inpSrc , inpMat)  = (Src , Mat)
----
DED.Query(inpSrc , inpMat)  = DED.Query(Src , Mat)
----
DED.Query(Src , Mat)
----
DED.Query(inpSrc) = Src
DED.Query(inpMat) = Mat
----

Anyone know the correct way to do this?

Mark



Mon, 26 Aug 2002 03:00:00 GMT  
 Passing variables to query parameters
I'm not sure if this helps, but I have a parameter query defined in my
database.  In my query I had to set my parameter list to include the
parameters.

When I created my DED command, I found the query, and the Parameter list was
populated.

To run the command, I typed the following:

DE.getTeamStatus (PMID)   'Where PMID was a parameter

This seemed to work.  Although, now I am having problems modifying data with
the resulting data.

Rich


Quote:

> I have a query command inside a DED that I need to pass 2 variables to.

> I have 2 parameters defined in the query as inpSrc and inpMat.

> I have tried :

> DED.Query(inpSrc , inpMat)  = Src , Mat
> ----
> DED.Query(inpSrc , inpMat)  = (Src , Mat)
> ----
> DED.Query(inpSrc , inpMat)  = DED.Query(Src , Mat)
> ----
> DED.Query(Src , Mat)
> ----
> DED.Query(inpSrc) = Src
> DED.Query(inpMat) = Mat
> ----

> Anyone know the correct way to do this?

> Mark



Mon, 26 Aug 2002 03:00:00 GMT  
 Passing variables to query parameters
Mark,
I am also having a parameter problem.  I am getting a Run-time Error 13,
Type mismatch" when trying to pass a value on to a query in the Data
Environment Designer.    My code is below.  I don't know if this helps you
at all.  Also do you see anything wrong with the way I am passing the second
parameter.  The second parameter is what is giving me the problem. I know
that I need quotes around the second parameter ( and I think I'm meeting
this requirement) but the Type mismatch error is telling me otherwise.
Dim prodcat As VbVarType

     Let prodcat = Chr(39) + dbcombo_ProdCat + Chr(39)
     'You must close the recordset before changing the parameter.
      If DataEnvironment1.rsUpd_StdCostByProdCat.State = adStateOpen Then
       DataEnvironment1.rsUpd_StdCostByProdCat.Close
      End If
    ' Reopen the recordset with the input parameter supplied by
    ' the TextBox control.
    Debug.Print prodcat
    DataEnvironment1.Upd_StdCostByProdCat StdCost.Text, prodcat



Quote:

> I have a query command inside a DED that I need to pass 2 variables to.

> I have 2 parameters defined in the query as inpSrc and inpMat.

> I have tried :

> DED.Query(inpSrc , inpMat)  = Src , Mat
> ----
> DED.Query(inpSrc , inpMat)  = (Src , Mat)
> ----
> DED.Query(inpSrc , inpMat)  = DED.Query(Src , Mat)
> ----
> DED.Query(Src , Mat)
> ----
> DED.Query(inpSrc) = Src
> DED.Query(inpMat) = Mat
> ----

> Anyone know the correct way to do this?

> Mark



Thu, 29 Aug 2002 03:00:00 GMT  
 Passing variables to query parameters

Quote:

> Mark,
> I am also having a parameter problem.  I am getting a Run-time Error 13,
> Type mismatch" when trying to pass a value on to a query in the Data
> Environment Designer.    My code is below.  I don't know if this helps you
> at all.  Also do you see anything wrong with the way I am passing the second
> parameter.  The second parameter is what is giving me the problem. I know
> that I need quotes around the second parameter ( and I think I'm meeting
> this requirement) but the Type mismatch error is telling me otherwise.
> Dim prodcat As VbVarType

>      Let prodcat = Chr(39) + dbcombo_ProdCat + Chr(39)
>      'You must close the recordset before changing the parameter.
>       If DataEnvironment1.rsUpd_StdCostByProdCat.State = adStateOpen Then
>        DataEnvironment1.rsUpd_StdCostByProdCat.Close
>       End If
>     ' Reopen the recordset with the input parameter supplied by
>     ' the TextBox control.
>     Debug.Print prodcat
>     DataEnvironment1.Upd_StdCostByProdCat StdCost.Text, prodcat

  Could you provide the details of each of these parameters from the
Parameters tab of the DE Command designer?  I assume that StdCost.Text
is a control that is displaying a number, and that you're trying to pass
prodcat as some kinda string (why not pass that one as
dbcombo_ProdCat.Text?) - we might spot the problem by comparing the
Parameter info in the Command design with the data types you are passing
in your code.  Thanks.
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"
 ((("What's so funny 'bout peace, love & understanding?" - Nick Lowe)))


Fri, 30 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Passing a variable as the parameter for a query

2. passing parameter to a parameter query

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

4. Passing Parameters into a Pass-Through Query

5. Passing parameters to SQLServer using a Pass-Through query

6. calling parameter query from a parameter query

7. Global Variable passed to Parameter

8. Passing a Variable Parameter

9. Passing a variable type parameter to an .asp file

10. Passing variables/parameters between forms - newbie question

11. Passing variable value as parameter

12. Passing a variable from VB.NET to a Crystal report parameter or formula with no prompt

 

 
Powered by phpBB® Forum Software