G
GTN170777
Hi Guys, me again!!!!
I've got a little recordset problem, basically I'm trying to build a jobs by
email feature, so I have the following -
Jobs by Email table which includes -
category
location
keyword
a form where an advertiser posts their vacancy, the form submits the data to
the database and then passes the data on to the page that processes the jobs
by email query -
currently the recordset for selecting all users with matching jobs by email
notifications looks like this --
<%
Dim jbeusers__MMColParam3
jbeusers__MMColParam3 = "0"
If (Session("SITEID") <> "") Then
jbeusers__MMColParam3 = Session("SITEID")
End If
%>
<%
Dim jbeusers__MMColParam
jbeusers__MMColParam = "0"
If (Session("NEWVACANCYLOCATION") <> "") Then
jbeusers__MMColParam = Session("NEWVACANCYLOCATION")
End If
%>
<%
Dim jbeusers__MMColParam2
jbeusers__MMColParam2 = "0"
If (Session("NEWVACANCYCATEGORY") <> "") Then
jbeusers__MMColParam2 = Session("NEWVACANCYCATEGORY")
End If
%>
<%
Dim jbeusers__MMColParam4
jbeusers__MMColParam4 = "%"
If (Session("NEWVACANCYDESCRIPTION") <> "") Then
jbeusers__MMColParam4 = Session("NEWVACANCYDESCRIPTION")
End If
%>
<%
Dim jbeusers
Dim jbeusers_cmd
Dim jbeusers_numRows
Set jbeusers_cmd = Server.CreateObject ("ADODB.Command")
jbeusers_cmd.ActiveConnection = MM_recruta2_STRING
jbeusers_cmd.CommandText = "SELECT JBENusername, JBENPassword, JBENname FROM
dbo.JBEmailNotification WHERE JBENsiteID = ? AND ? = JBENlocation AND ? =
JBENcategory AND JBENKeyword LIKE ?"
jbeusers_cmd.Prepared = true
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param1", 5, 1,
-1, jbeusers__MMColParam3) ' adDouble
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param2", 200,
1, 255, jbeusers__MMColParam) ' adVarChar
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param3", 200,
1, 255, jbeusers__MMColParam2) ' adVarChar
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param4", 200,
1, 255, "%" + jbeusers__MMColParam4 + "%") ' adVarChar
Set jbeusers = jbeusers_cmd.Execute
jbeusers_numRows = 0
%>
this works fine if the variables are -
MMColParam3 = 31
MMColParam = Hereford
MMColParam2 = IT
MMColParam4 = dreamweaver
as I have two records in the jobs by email table that match this criteria...
However as MMColParam4 is the advert description, it would contain more than
just dreamweaverr in it, for instance when i try and use the value "we
urgently require dreamweaver developers"
The recordset returns no records...
effectively what I'm trying to do is filter records where the siteid,
location and category match of the advert and the jobs by email keyword is
contained within the description,..
Anyone got any ideas what I'm doing wrong?
Thank you
I've got a little recordset problem, basically I'm trying to build a jobs by
email feature, so I have the following -
Jobs by Email table which includes -
category
location
keyword
a form where an advertiser posts their vacancy, the form submits the data to
the database and then passes the data on to the page that processes the jobs
by email query -
currently the recordset for selecting all users with matching jobs by email
notifications looks like this --
<%
Dim jbeusers__MMColParam3
jbeusers__MMColParam3 = "0"
If (Session("SITEID") <> "") Then
jbeusers__MMColParam3 = Session("SITEID")
End If
%>
<%
Dim jbeusers__MMColParam
jbeusers__MMColParam = "0"
If (Session("NEWVACANCYLOCATION") <> "") Then
jbeusers__MMColParam = Session("NEWVACANCYLOCATION")
End If
%>
<%
Dim jbeusers__MMColParam2
jbeusers__MMColParam2 = "0"
If (Session("NEWVACANCYCATEGORY") <> "") Then
jbeusers__MMColParam2 = Session("NEWVACANCYCATEGORY")
End If
%>
<%
Dim jbeusers__MMColParam4
jbeusers__MMColParam4 = "%"
If (Session("NEWVACANCYDESCRIPTION") <> "") Then
jbeusers__MMColParam4 = Session("NEWVACANCYDESCRIPTION")
End If
%>
<%
Dim jbeusers
Dim jbeusers_cmd
Dim jbeusers_numRows
Set jbeusers_cmd = Server.CreateObject ("ADODB.Command")
jbeusers_cmd.ActiveConnection = MM_recruta2_STRING
jbeusers_cmd.CommandText = "SELECT JBENusername, JBENPassword, JBENname FROM
dbo.JBEmailNotification WHERE JBENsiteID = ? AND ? = JBENlocation AND ? =
JBENcategory AND JBENKeyword LIKE ?"
jbeusers_cmd.Prepared = true
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param1", 5, 1,
-1, jbeusers__MMColParam3) ' adDouble
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param2", 200,
1, 255, jbeusers__MMColParam) ' adVarChar
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param3", 200,
1, 255, jbeusers__MMColParam2) ' adVarChar
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param4", 200,
1, 255, "%" + jbeusers__MMColParam4 + "%") ' adVarChar
Set jbeusers = jbeusers_cmd.Execute
jbeusers_numRows = 0
%>
this works fine if the variables are -
MMColParam3 = 31
MMColParam = Hereford
MMColParam2 = IT
MMColParam4 = dreamweaver
as I have two records in the jobs by email table that match this criteria...
However as MMColParam4 is the advert description, it would contain more than
just dreamweaverr in it, for instance when i try and use the value "we
urgently require dreamweaver developers"
The recordset returns no records...
effectively what I'm trying to do is filter records where the siteid,
location and category match of the advert and the jobs by email keyword is
contained within the description,..
Anyone got any ideas what I'm doing wrong?
Thank you