samporras Posted June 14, 2004 Posted June 14, 2004 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? Quote
samporras Posted June 15, 2004 Author Posted June 15, 2004 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 Quote
TCH-Rob Posted June 15, 2004 Posted June 15, 2004 Have you tried here; http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vserrloopwithoutdo.asp http://www.haneng.com/Forums_Post.asp?id=10369 http://www.html.dk/dokumentation/vbscript/HTML/vserrloopwithoutdo.htm I found a bunch when I googled "loop without do" including quotes. Quote
samporras Posted June 15, 2004 Author Posted June 15, 2004 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 Quote
TCH-Rob Posted June 15, 2004 Posted June 15, 2004 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.