Forums
This topic is locked
recordset filtered with multiple parameters
Posted 07 Jul 2008 12:11:48
1
has voted
07 Jul 2008 12:11:48 Giancarlo Barba posted:
hi. i have a mailing list to send a news-letter to my users. they are grouped by category and language and some have a denied the agrement to receive e-mail. I use smart mailer ASP 1.0.7.. work fine but in the recordset where i select my receivers i cant select by category and e-mail. I have a error
my record set is
<%
Dim rsreceivers__MMColParam
rsreceivers__MMColParam = "1"
If (rsmessage.fields.item("receivers".value <> "" Then
rsreceivers__MMColParam = rsmessage.fields.item("receivers".value
End If
%>
<%
Dim rsreceivers__MMColParam2
rsreceivers__MMColParam2 = "1"
If (rsmessage.fields.item("language".value <> "" Then
rsreceivers__MMColParam2 = rsmessage.fields.item("language".value
End If
%>
<%
Dim rsreceivers
Dim rsreceivers_cmd
Dim rsreceivers_numRows
Set rsreceivers_cmd = Server.CreateObject ("ADODB.Command"
rsreceivers_cmd.ActiveConnection = MM_cnn_STRING
if rsmessage.fields.item("receivers".value = 0 then
rsreceivers_cmd.CommandText = "SELECT * FROM user WHERE consent = 1 AND language = ?"
Else
rsreceivers_cmd.CommandText = "SELECT * FROM utenti WHERE category = ? AND consent = 1 AND language = ?"
End If
rsreceivers_cmd.Prepared = true
rsreceivers_cmd.Parameters.Append rsreceivers_cmd.CreateParameter("param1", 5, 1, -1, rsreceivers__MMColParam) ' adDouble
rsreceivers_cmd.Parameters.Append rsreceivers_cmd.CreateParameter("param2", 5, 1, -1, rsreceivers__MMColParam2) ' adDouble
Set rsreceivers = rsreceivers_cmd.Execute
rsreceivers_numRows = 0
%>
when i try to send message i receive a error message
"Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
/cms/invia.asp, line 55"
line 55 is
"Set rsreceivers = rsreceivers_cmd.Execute"
can anyone say me how i can change my recordset to work?
thanks