Advanced Recorset Modification
I am trying to make an advanced recordset. I need some to help for that.
Need:
I am making a search page & results page with multiple parameters. For that I have to use Advaced recordset options. I have got some ten input fileds in the search form. in the result page I have setup the Advanced recordset writing Sql Query using AND to make the results very particular. It works fine. THE PROBLEM IS, unless, I enter all the parameters the recordset returns empty. I want to make some fields optional by adding a check box in the search page.. sothat I can get the results even without entering all the ten parameters.
Can anyone tell me how to modify the Sql query & other possible solutions
My search page:
Contains some 4 select inputs, 4 text inputs.
I am posting the search page into the result page by method of "GET"
my Result page's recod set is as follows:
<%
var multiSearchSearch = Server.CreateObject("ADODB.Recordset");
multiSearchSearch.ActiveConnection = MM_lauConn_STRING;
multiSearchSearch.Source = "SELECT * FROM jskr_info WHERE Functional_area = '"+ multiSearchSearch__varFunct.replace(/'/g, "''") + "' AND Industrial_type = '"+ multiSearchSearch__varIndu.replace(/'/g, "''") + "' AND Highest_education = '"+ multiSearchSearch__varEdu.replace(/'/g, "''") + "' AND Exp_year BETWEEN '"+ multiSearchSearch__varExpMin.replace(/'/g, "''") + "' AND '"+ multiSearchSearch__varExpMax.replace(/'/g, "''") + "' AND curr_salary BETWEEN '"+ multiSearchSearch__varCsalMin.replace(/'/g, "''") + "' AND '"+ multiSearchSearch__varCsalMax.replace(/'/g, "''") + "' AND Location_cur = '"+ multiSearchSearch__varLoc.replace(/'/g, "''") + "' ORDER BY Modified_on";
multiSearchSearch.CursorType = 0;
multiSearchSearch.CursorLocation = 2;
multiSearchSearch.LockType = 1;
multiSearchSearch.Open();
var multiSearchSearch_numRows = 0;
%>
I want to make the WHERE.....AND....AND.....AND... thing into optional. Sothat these variable's will be evoked only if the user has checked the check box near to each field.
Can Anybody help me.......
Comments
Be the first to write a comment
You must me logged in to write a comment.