I have a search box that I would like the user to be able to search for a client by their last name or client id number. However, I get the following error when I try to run the application. This page is connected to a sql server database. Any help or suggestions on fixing this problem will be greatly appreciated.
Error
Microsoft VBScript compilation error '800a03ea'
Syntax error
/clientListNew.asp, line 172
if isNumeric(strLetter) then
Code
dim strCombine
strCombine = strLetter & strString & " "
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 and " & _
if isNumeric(strLetter) then
"Clients.ID LIKE '" & strCombine & "%' " & _
else
"Clients.LastName LIKE '" & strCombine & "%' " & _
end if
"Order by Clients.LastName, Clients.FirstName"
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") & " and " & _
if isNumeric(strCombine) then
"Clients.ID LIKE '" & strCombine & "%' " & _
else
"Clients.LastName LIKE '" & strCombine & "%' " & _
end if
"Order by Clients.LastName, Clients.FirstName" & _
end if
Error
Microsoft VBScript compilation error '800a03ea'
Syntax error
/clientListNew.asp, line 172
if isNumeric(strLetter) then
Code
dim strCombine
strCombine = strLetter & strString & " "
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 and " & _
if isNumeric(strLetter) then
"Clients.ID LIKE '" & strCombine & "%' " & _
else
"Clients.LastName LIKE '" & strCombine & "%' " & _
end if
"Order by Clients.LastName, Clients.FirstName"
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") & " and " & _
if isNumeric(strCombine) then
"Clients.ID LIKE '" & strCombine & "%' " & _
else
"Clients.LastName LIKE '" & strCombine & "%' " & _
end if
"Order by Clients.LastName, Clients.FirstName" & _
end if