Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft VBScript compilation error '800a03ea' 1

Status
Not open for further replies.

frmorris

Programmer
Aug 4, 2005
22
US
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
 
It's the line continuation combined with the IF block that is causing your problem.

Code:
dim strCombine
     strCombine = strLetter & strString & " "

[blue]
Dim strLike

if isNumeric(strLetter) then

      strLike = "Clients.ID LIKE '" & strCombine & "%' "
else                    
      strLike = "Clients.LastName LIKE '" & strCombine & "%' "
end if
[/blue]
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 " & _
      [blue]strLike & _[/blue]

"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

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top