Hi All,
A have a list of links that are painted from a db table called Segments. Which are just a list of categories. Also I have a table of companies which belong to one of the Segments.
Some of the categories have too many records to show all of them and even paging by 50 records at the time it takes many clicks to go to a desired company. To simplify it I have created a form with a select menu where the user can call companies in by the first letter of their name.
The name of the select is "search" This works fine but it is calling companies from all segments and I only want to call segment 2.
What would be the best way to do it?
when only my list of segments is called, the url looks like this:
http://www.mysite.com/segments.asp
when you select one segment looks:
http://www.mysite.com/segments.as?id=2
when you call the companies by letter:
http://www.mysite.com/segments.as?search=m
How can I make it so the url shows:
http://www.mysite.com/segments.as?id=2&search=m
help!!! Any idea or direction.
my code looks like this:
Code:
<%
Dim rsCompanies__Param
rsCompanies__Param = "%"
If (Request.QueryString("id") <> "") Then
rsCompanies__Param = Request.QueryString("id")
End If
%>
<%
Dim rsCompanies__Param1
rsCompanies__Param1 = "%"
If (Request.QueryString("search") <> "") Then
rsCompanies__Param1 = Request.QueryString("search")
End If
%>
<%
Dim rsCompanies
Dim rsCompanies_cmd
Dim rsCompanies_numRows
Set rsCompanies_cmd = Server.CreateObject ("ADODB.Command")
rsCompanies_cmd.ActiveConnection = MM_connoelpages07_STRING
rsCompanies_cmd.CommandText = "SELECT intCompanyID, intSegment, txtCompany, txtWebsite, txtSegment FROM AllCompanies, tblSegments WHERE intSegment = intSegmentID AND intSegmentID LIKE ? AND bitShow = 1 AND txtCompany LIKE ? ORDER BY txtCompany"
rsCompanies_cmd.Prepared = true
rsCompanies_cmd.Parameters.Append rsCompanies_cmd.CreateParameter("param1", 200, 1, 255, rsCompanies__Param) ' adVarChar
rsCompanies_cmd.Parameters.Append rsCompanies_cmd.CreateParameter("param2", 200, 1, 255, rsCompanies__Param1 + "%") ' adVarChar
Set rsCompanies = rsCompanies_cmd.Execute
rsCompanies_numRows = 0
%>