Thre's more than one way to acomplish that. Using XML is my favorite. See
Re: Variable IN Message #
834232>
>I need to used the following statement in a stored procedure:
>
>Select * from Fruits where FruitName in ('Apple', 'Banana', 'Coconuts')
>
>Apple, Banana, & Coconut are values that will be supplied by the user using a listbox which allows multiple selection. There is no limit on the number of items that the user can select. It can be 1 or 10 or more. Is there a way I can pass these values into a single paramter so I can use it like:
>
>Select * from Fruits where FruitName in (@Parameter)
>
>I have tried putting all the values in a single variable formated for the IN clause.
>
>x="'Apple', 'Banana', 'Coconut'"
>
>Passing this to the stored procedure generates an error "To many parameters passed!" which is true because when...
>
>cn.Execute("spFruit " & x)
>
>... is evaluated it looks like...
>
>cn.Execute("spFruit 'Apple', 'Banana', 'Coconut'")
>
>... which passed 3 parameters to spFruit which only accepts 1 parameter. Anyone with ideas on how I can tackle this?
--sb--