Jump to content

Recommended Posts

Posted

I'm working on a site that has a connection to a database. I keep getting an error that says:

 

Microsoft VBScript compilation error '800a040e'

 

'loop' without 'do'

 

/BusCardInquiry/BusCardresults.asp, line 291

 

Loop

^

 

the site is basically a search site that creates an SQL statement and inserts a where claus based on the inputed criterea.

 

i've checked the code and everything seems ok. I used the same exact loop with out the 'do' in a very similar site and everything was working fine. Any suggestions?

Posted

Well....I've been working on this problem for about 4 hours and still no closer than I was before. I guess this teaches me a lesson to always save a copy of "what works". (I made some changes to the site and published it to the web to test it but forgot to save the original code that worked.)

 

I google searched the error message but no help.

 

I'm going to work on this tomorrow and I'll post the solution when I figure it out.

 

-Sam

Posted

Thanks for the links Rob! I didn't know that putting quotes around a search string affected the search.

 

I actually figured out what was wrong with my code. There was nothing wrong with my loop statement. I had a nested if statement inside the loop where I was displaying the results set and for some reason, vbScript does not like spaces in the 'elseif' statements. It's funny how 90% of the time one little error like this can cause hours of headaches.

 

Here's an example of what a correct if statement should look in VB script.

 

><%if left(varCT,3)="DA9" or left(varCT,3)="NC6" then%>
 Inbound
<%elseif left(varCT,3)="DA2" then%>
 Outbound
<%elseif varSource="2" then%>	
 OLB
<%else%>
 SS   
<%end if%>

 

I hope this post saves some other hours of headaches. Have a great day!

 

-Sam

Posted

Sam,

 

I dont know jack about VB other than it is two letters off of a bad time. That said, if looking for a particular search string that must be found in that exact order, putting quotes around the phrase will only return pages with that exact phrase in it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...