Jump to content

3 select+1 form +1 submit


Recommended Posts

hi everyone,after long search from net ,i came with a solution which work..BUT its not displaying properly.in my asp page i have 3 select box and one submit button,with my actual codefor example sql1 i can see on one selected data or with sql2 i can see a combine result.i want to view both sql 1 sql2 result what can i implement for it to work here is my code:

<form id="form2" name="form2" method="post" action="g1.asp">	<p>Select Catagory	  <select name="category" id="catselID" >		<option selected="selected">select</option>		<option>Banks Insurance Other Finance</option>		<option>Commerce</option>		<option>Industry</option>		<option>Investments</option>		<option>Leisure & Hotels</option>		<option>Sugar</option>		<option>Transport</option>		<option>Foreign</option>	  </select>	  </p>	<p>Select Company name	  <select name="companyname" id="compselID">		<option selected="selected">select</option>		<option >The mcl Bank Ltd</option>		<option >me Insurance Co. ltd</option>		<option >ml Co. ltd</option>		<option >mua Co.ltd</option>		<option >sbm ltd</option>		<option >swan</option>	  </select>	</p>	<p>			Select released period	  <select name="releasedperiod" id="relselID">		<option selected>select</option>		<option >Week</option>		<option >One Month</option>		<option >Three Month</option>		<option >One Year</option>		<option >Earlier</option>		</select>		</p>	<p>	  <input type="submit" name="Submit" value="Submit" id="submit1" >	</p></form>  </td>  <tr></table><table><td><%Dim catDim objConn1,objRS2,sql3cat = Request.Form("category")comp = Request.Form("companyname")rel = Request.Form("releasedperiod")Set objConn1 = Server.CreateObject("ADODB.Connection")Set objRS2 = Server.CreateObject("ADODB.Recordset")Set sql3 = Server.CreateObject("ADODB.Recordset")objConn1.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("\cmb\test.mdb")sql3="SELECT  * FROM officialcompanyreports where (Catagories='"& cat &"') or (Companyname='"& comp &"') or  (ReleasePeriod='"& rel &"') UNION ALL  SELECT  * FROM officialcompanyreports where (Companyname='"& comp &"' and ReleasePeriod='"& rel &"') or ( (Catagories='"& cat &"' and Companyname='"& comp &"')) or (Catagories='"& cat &"' and ReleasePeriod='"& rel &"')"	set objRS2= objConn1.Execute (sql3)if (objRS2.BOF and objRS2.EOF) then	response.write "No records found"	response.end	End If	Response.Write "<TR BGCOLOR=""#C2C285"">"For i = 0 to objRS2.Fields.Count - 1Response.Write "<TH><div align=""left""><FONT FACE=""ARIAL"" SIZE=""2"" COLOR=""00000"">" & objRS2.Fields(i).Name & "</FONT></div></TH>"NextResponse.write "</TR>"objRS2.MoveFirstDo While Not objRS2.EOF		Response.Write "<TR>"	For i = 0 to objRS2.Fields.Count - 1		Response.Write "<TD align=""center""><div align=""left""><FONT FACE=""ARIAL"" SIZE=""1"">" & objRS2.Fields(i) & "</FONT></div></TD>"	NextResponse.write "</TR>"objRS2.MoveNext	LoopobjRS2.Closeset objRS2 = Nothing

any help will be greatfull

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...