Connecting Tech Pros Worldwide Forums | Help | Site Map

MultiSelect List boxes as query parameters

Newbie
 
Join Date: Sep 2008
Posts: 10
#1: Jun 29 '09
i am trying to pass the value "comapre" of 2,3, or 4 checkbox to next page
but i am getting errors.
Application uses a value of the wrong type for the current operation. LINE
rsSearch_cmd.Parameters.Append rsSearch_cmd.CreateParameter("param1", 5, 1, -1, rsSearch__MMColParam) ' adDouble

Query string is like this

compare.asp?compare=466&compare=4600

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim rsSearch__MMColParam
  3. rsSearch__MMColParam = "%"
  4. If (Request.QueryString("compare") <> "") Then 
  5.   rsSearch__MMColParam = Request.QueryString("compare")
  6. End If
  7. %>
  8. <%
  9. Dim rsSearch
  10. Dim rsSearch_cmd
  11. Dim rsSearch_numRows
  12.  
  13. Set rsSearch_cmd = Server.CreateObject ("ADODB.Command")
  14. rsSearch_cmd.ActiveConnection = MM_classifieds_STRING
  15. rsSearch_cmd.CommandText = "SELECT * FROM dbo.NEWS WHERE NEWS_ID IN (?)" 
  16. rsSearch_cmd.Prepared = true
  17. rsSearch_cmd.Parameters.Append rsSearch_cmd.CreateParameter("param1", 5, 1, -1, rsSearch__MMColParam) ' adDouble
  18.  
  19. Set rsSearch = rsSearch_cmd.Execute
  20. rsSearch_numRows = 0
  21.  
  22.  
  23. %>  
  24.  
Is there another way to do this.

Thank you

jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,724
#2: Jul 1 '09

re: MultiSelect List boxes as query parameters


every point of data that goes through querystring is interpreted as a string. You will have to convert it to a number with cint() or some such. does this make sense?

Jared
Newbie
 
Join Date: Sep 2008
Posts: 10
#3: Jul 1 '09

re: MultiSelect List boxes as query parameters


can you guide to some kind of tutorial how to this

Thank you
Reply