I have an asp page that is linked to a sql server database. At first the page only search by the client's last name, but the user needed to search by client id as well. Well I got the search box to search by the client's last name and client id, but when I did that, it broke the letter based paging. I would really appreciate it if someone would take a look at my code and help me figure out why my based paging is not work. The name of the based paging is strLetter. Thank you in advance.
dim strCombine
strCombine = strLetter & strString & " "
Dim strLike
dim strQuery
if isAdmin then
'Show all clients who have not been closed
strQuery = "Select Clients.ID, Clients.FirstName, Clients.LastName, Clients.Address, Clients.City, Clients.State, Clients.Zip, Clients.Phone, Clients.MentorID, Clients.DistrictID from Clients " & _
"Where " & _
"Clients.isClosed=0 "
else
'Only show new clients who have not yet been assigned a mentor
strQuery = "Select Clients.ID, Clients.FirstName, Clients.LastName, Clients.Address, Clients.City, Clients.State, Clients.Zip, Clients.Phone, Clients.MentorID, Clients.DistrictID from Clients " & _
"Where " & _
"Clients.isClosed=0 and " & _
"Clients.MentorID=0 and " & _
"Clients.DistrictID = " & Session("intDistrictID") & " "
end if
if strString <> "" then
if isNumeric(strString) then
strLike = " Clients.ID = " & strString
strQuery = strQuery & "and " & strLike & " "
else
strLike = " Clients.LastName LIKE '" & strLetter & strString & "%' "
strQuery = strQuery & "and " & strLike & " "
end if
strQuery = strQuery & "Order by Clients.LastName, Clients.FirstName, Clients.ID"
end if
dim strCombine
strCombine = strLetter & strString & " "
Dim strLike
dim strQuery
if isAdmin then
'Show all clients who have not been closed
strQuery = "Select Clients.ID, Clients.FirstName, Clients.LastName, Clients.Address, Clients.City, Clients.State, Clients.Zip, Clients.Phone, Clients.MentorID, Clients.DistrictID from Clients " & _
"Where " & _
"Clients.isClosed=0 "
else
'Only show new clients who have not yet been assigned a mentor
strQuery = "Select Clients.ID, Clients.FirstName, Clients.LastName, Clients.Address, Clients.City, Clients.State, Clients.Zip, Clients.Phone, Clients.MentorID, Clients.DistrictID from Clients " & _
"Where " & _
"Clients.isClosed=0 and " & _
"Clients.MentorID=0 and " & _
"Clients.DistrictID = " & Session("intDistrictID") & " "
end if
if strString <> "" then
if isNumeric(strString) then
strLike = " Clients.ID = " & strString
strQuery = strQuery & "and " & strLike & " "
else
strLike = " Clients.LastName LIKE '" & strLetter & strString & "%' "
strQuery = strQuery & "and " & strLike & " "
end if
strQuery = strQuery & "Order by Clients.LastName, Clients.FirstName, Clients.ID"
end if