Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a SP with changing Parameters

Status
Not open for further replies.

Gatorajc

MIS
Mar 1, 2002
423
0
0
US
Not exactly a coding question more of a logic question.

I have this shipping screen. It has a select/text box that you can make multiple selections. (its one of those Javascript codes where you click a button and it moves the choice from the left box to the right). Well when it submits it submits a string like this.

Tires,Wheels,Caps

Now these will be used as part of a query. Something like this. They will be the product variable.
Code:
set cmdSearch = server.CreateObject("ADODB.Command")
    set rsOrder = server.CreateObject("ADODB.Recordset")  cmdSearch.ActiveConnection = oConnADS
		cmdSearch.CommandText = "sel_HighOutputStn1_sp"
		cmdSearch.CommandType = 4
		cmdSearch.Parameters.refresh()
		'cmdSearch.Parameters("@Customer") = Customer
		'cmdSearch.Parameters("@OrderDate") = OrderDate
'cmdSearch.Parameters("@Product") = Product 
	set rsOrder = cmdSearch.Execute
Now my question is. How should I go about querying by those products. Break it a part and loop through each one or is there a way to break in Sql Server? Anyone else have an issue like this.

AJ
[americanflag]

Do you feel lucky?


 
Can you edit the stored procedure to use :

Code:
WHERE YourCriteria IN(YourCommaDelimitedListOfSelectedItems)

instead of "WHERE YourCriteria = " within the stored procedure ?

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top