Vbscript Error

liunx

Guest
I'm working on a site that has a connection to a database. I keep getting an error that says:<br /><br />Microsoft VBScript compilation error '800a040e' <br /><br />'loop' without 'do' <br /><br />/BusCardInquiry/BusCardresults.asp, line 291 <br /><br />Loop<br />^<br /><br />the site is basically a search site that creates an SQL statement and inserts a where claus based on the inputed criterea.<br /><br />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?<!--content-->
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.)<br /><br />I google searched the error message but no help.<br /><br />I'm going to work on this tomorrow and I'll post the solution when I figure it out.<br /><br />-Sam<!--content-->
Have you tried here;<br /><br /><!--coloro:blue--><span style="color:blue"><!--/coloro-->http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vserrloopwithoutdo.asp<!--colorc--></span><!--/colorc--><br /><br /><!--coloro:blue--><span style="color:blue"><!--/coloro-->http://www.haneng.com/Forums_Post.asp?id=10369<!--colorc--></span><!--/colorc--><br /><br /><!--coloro:blue--><span style="color:blue"><!--/coloro-->http://www.html.dk/dokumentation/vbscript/HTML/vserrloopwithoutdo.htm<!--colorc--></span><!--/colorc--><br /><br />I found a bunch when I googled "loop without do" including quotes.<!--content-->
Thanks for the links Rob! I didn't know that putting quotes around a search string affected the search.<br /><br />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, <i>vbScript does not like spaces in the 'elseif' statements.</i> It's funny how 90% of the time one little error like this can cause hours of headaches. <br /><br />Here's an example of what a correct if statement should look in VB script.<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><%if left(varCT,3)="DA9" or left(varCT,3)="NC6" then%><br />  Inbound<br /><%elseif left(varCT,3)="DA2" then%><br />  Outbound<br /><%elseif varSource="2" then%>    <br />  OLB<br /><%else%><br />  SS   <br /><%end if%><!--c2--></div><!--ec2--><br /><br />I hope this post saves some other hours of headaches. Have a great day!<br /><br />-Sam<!--content-->
Sam,<br /><br />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.<!--content-->
 
Top