I am having trouble with Access and an ASP Search Page
I have 4 fields to search
Specification
Type
Thickness
Diameter
Specification and Type are dropdown menus
Thickness and Diameter are text fields which will be checked to see if they are between two numbers
I want to be able to leave Thickness and Diameter blank if need be and show all the results that match the other fields.
Thanks in advanceCode:<% Dim rsSpec__MMColParam rsSpec__MMColParam = "0" If (Request.Form("mnu_spec") <> "") Then rsSpec__MMColParam = Request.Form("mnu_spec") End If %> <% Dim rsSpec__MMColParam1 rsSpec__MMColParam1 = "0" If (Request.Form("txt_type") <> "") Then rsSpec__MMColParam1 = Request.Form("txt_type") End If %> <% Dim rsSpec__MMColParam2 rsSpec__MMColParam2 = "0" If (Request.Form("txt_thickness") <> "") Then rsSpec__MMColParam2 = Request.Form("txt_thickness") End If %> <% Dim rsSpec__MMColParam3 rsSpec__MMColParam3 = "0" If (Request.Form("txt_thickness") <> "") Then rsSpec__MMColParam3 = Request.Form("txt_thickness") End If %> <% Dim rsSpec__MMColParam4 rsSpec__MMColParam4 = "0" If (Request.Form("txt_diameter") <> "") Then rsSpec__MMColParam4 = Request.Form("txt_diameter") End If %> <% Dim rsSpec__MMColParam5 rsSpec__MMColParam5 = "0" If (Request.Form("txt_diameter") <> "") Then rsSpec__MMColParam5 = Request.Form("txt_diameter") End If %> <% Dim rsSpec Dim rsSpec_cmd Dim rsSpec_numRows Set rsSpec_cmd = Server.CreateObject ("ADODB.Command") rsSpec_cmd.ActiveConnection = MM_connWP_STRING rsSpec_cmd.CommandText = "SELECT * FROM qry_weld_pro WHERE spec_name = ? AND wp_grade = ? AND wp_wt_from <= ? AND wp_wt_to >= ? AND wp_ps_from <= ? AND wp_ps_to >= ?" rsSpec_cmd.Prepared = true rsSpec_cmd.Parameters.Append rsSpec_cmd.CreateParameter("param1", 200, 1, 255, rsSpec__MMColParam) ' adVarChar rsSpec_cmd.Parameters.Append rsSpec_cmd.CreateParameter("param2", 200, 1, 255, rsSpec__MMColParam1) ' adVarChar rsSpec_cmd.Parameters.Append rsSpec_cmd.CreateParameter("param3", 5, 1, -1, rsSpec__MMColParam2) ' adDouble rsSpec_cmd.Parameters.Append rsSpec_cmd.CreateParameter("param4", 5, 1, -1, rsSpec__MMColParam3) ' adDouble rsSpec_cmd.Parameters.Append rsSpec_cmd.CreateParameter("param5", 5, 1, -1, rsSpec__MMColParam4) ' adDouble rsSpec_cmd.Parameters.Append rsSpec_cmd.CreateParameter("param6", 5, 1, -1, rsSpec__MMColParam5) ' adDouble Set rsSpec = rsSpec_cmd.Execute rsSpec_numRows = 0 %>
ste


Reply With Quote
Much Appreciated


Bookmarks