Multiple references to the same named parameter fails?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



In SQL Mobile 2005, I have a query that references the same named
parameter twice, like this (meaningless) query:

select * from users where userid=@userid or userid=@userid

When I run this, I get a SqlCeException with the helpful message "[
@userid ]"

How am I supposed to use the same variable twice? Or should I work
around it by declaring two variables with the same value?

Thanks!

Richard.

.



Relevant Pages

  • Re: I use the same parameter in 2 queries - how do I only enter once?
    ... Enter it in a control of a form? ... Then, use the syntax FORMS!formNameHere!ControlNameHere ... for each query. ... need to supply the parameter twice. ...
    (microsoft.public.access.queries)
  • RE: Parameter query question
    ... Do you get the enter parameter twice when directly opening the query or when ... Try copy and paste the SQL into a new blank query and see if you get ... prompted twice. ... "Duane Hookom" wrote: ...
    (microsoft.public.access.queries)
  • RE: Parameter query question
    ... I get the enter parameter twice when I click directly on the query and ... "Duane Hookom" wrote: ... Do you get the enter parameter twice when directly opening the query or when ...
    (microsoft.public.access.queries)
  • 2 Parameters with the same Name
    ... I have a Query like this: ... is there a way to use the same Parameter twice in a TADOQuery without ... Thank you, Christof ...
    (borland.public.delphi.database.ado)