Connecting Tech Pros Worldwide Help | Site Map

MultiSelect List boxes as query parameters

  #1  
Old June 29th, 2009, 02:58 PM
Newbie
 
Join Date: Sep 2008
Posts: 10
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
  #2  
Old July 1st, 2009, 05:00 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,686

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
  #3  
Old July 1st, 2009, 05:07 PM
Newbie
 
Join Date: Sep 2008
Posts: 10

re: MultiSelect List boxes as query parameters


can you guide to some kind of tutorial how to this

Thank you
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make this 'simple' query? Eddie Smit answers 6 November 12th, 2005 03:09 PM