I am using DW CC2014 to create a recordset. Yet, I am getting an error. When I run the query in MS SQL Manager it returns the correct values.
-- error displayed --
ADODB.Command error '800a0d5d'
Application uses a value of the wrong type for the current operation.
/bluedot/includes/bdot/recordsets.asp, line 294
-- recordset code --
<%
Dim rs_qnrgroupcount__MMColParam
rs_qnrgroupcount__MMColParam = "0"
If (Session("FirmId") <> "") Then
rs_qnrgroupcount__MMColParam = Session("FirmId")
End If
%>
<%
Dim rs_qnrgroupcount__MMColParam2
rs_qnrgroupcount__MMColParam2 = "0"
If (rs_qnrgroup("GuestIds") <> "") Then
rs_qnrgroupcount__MMColParam2 = rs_qnrgroup("GuestIds")
End If
%>
<%
Dim rs_qnrgroupcount
Dim rs_qnrgroupcount_cmd
Dim rs_qnrgroupcount_numRows
Set rs_qnrgroupcount_cmd = Server.CreateObject ("ADODB.Command")
rs_qnrgroupcount_cmd.ActiveConnection = MM_bluedot_STRING
rs_qnrgroupcount_cmd.CommandText = "SELECT COUNT (a.Id) AS total FROM QnrsMailed a inner join users as b on a.sentby = b.userid WHERE a.Firmid = ? and a.Originatedby IN (?) AND a.IsAccepted = 2"
rs_qnrgroupcount_cmd.Prepared = true
rs_qnrgroupcount_cmd.Parameters.Append rs_qnrgroupcount_cmd.CreateParameter("param1", 5, 1, -1, rs_qnrgroupcount__MMColParam) ' adDouble
rs_qnrgroupcount_cmd.Parameters.Append rs_qnrgroupcount_cmd.CreateParameter("param2", 5, 1, -1, rs_qnrgroupcount__MMColParam2) ' adDouble
Set rs_qnrgroupcount = rs_qnrgroupcount_cmd.Execute
rs_qnrgroupcount_numRows = 0
%>
---
the values are replaced with the following:
MMColParam = 2
MMColParam2 = 1713
rs_qnrgroup("GuestIds") = 30324, 1713, 5001, 22278, 30351
-- the query when ran replacing values to test on SQL Manager goes like --
SELECT COUNT (a.Id) AS total
FROM QnrsMailed a INNER JOIN users as b on a.sentby = b.userid
WHERE a.Firmid = 2 and a.Originatedby IN (30324, 1713, 5001, 22278, 30351) AND a.IsAccepted = 2
-- the returned value is: 1
So it works well there. So .. there is something wrong with my ASP code.
Help is appreciated ! I am stuck !
A