Jump to content

'loop' without 'do' error (but 'do' is there)


Recommended Posts

Okay it says there is a loop without do, but I have do in the code in the correct format so I am confused. Here is the error and code:Error

Microsoft VBScript compilation error '800a040e''loop' without 'do'/LoginCharacter.asp, line 121loop^

Code:

<%dim IDID=Request.querystring("ID")%><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT Name FROM Characters WHERE ID = " & ID & "", conndo until rs.EOF  for each x in rs.Fields	Response.Cookies("usernamechar")="" & x.value & ""  next  rs.MoveNextlooprs.closeconn.close%><%usernamechar=Request.Cookies("usernamechar")%><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT [last-logged] FROM Characters WHERE Name = '" & usernamechar & "'", conndo until rs.EOF  for each x in rs.Fields   dim lastlogged   lastlogged=x.value  next  rs.MoveNextlooprs.closeconn.close%><%dim newturnsnewturns=DateDiff("h",lastlogged,Now())set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT Turns FROM Characters WHERE Name = '" & usernamechar & "'", conndo until rs.EOF  for each x in rs.Fields   dim turns   turns=x.value  next  rs.MoveNextlooprs.closeconn.close%><%finalturns=newturns+turns%><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"sql="UPDATE Characters SET Turns=" & finalturns & " WHERE Name = '" & usernamechar & "'"conn.Execute sql,Recordsaffectedconn.close%><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"sql="UPDATE Characters SET [last-logged]=#" & NOW() & "# WHERE Name = '" & usernamechar & "'"conn.Execute sql,Recordsaffectedconn.close%><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"sql="INSERT INTO Active_Users (Name,[Value],Last_moved)"sql=sql & " VALUES "sql=sql & "('" & usernamechar & "', 1, #" & NOW() & "#)"on error resume nextconn.Execute sql,recaffectedif err<>0 then  Response.Write("error")else  Response.Write("<h3>" & recaffected & " record added</h3>")end ifconn.close%><%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT incombat FROM Characters WHERE ID = " & ID & "", conndo until rs.EOF  for each x in rs.Fields   dim incombat   incombat="" & x.value & ""loop rs.closeconn.closeset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT cRound FROM Characters WHERE ID = " & ID & "", conndo until rs.EOF  for each x in rs.Fields   dim cRound   cRound=x.valueloop rs.closeconn.closeset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT CombatID FROM Characters WHERE ID = " & ID & "", conndo until rs.EOF  for each x in rs.Fields   dim CombatID   CombatID=x.valueloop rs.closeconn.closeIf incombat="YES" thenresponse.Cookies("currentpage")="Combat/combat.asp?lastincombat=1&round=" & cRound & "&ID=" & CombatID & ""response.redirect("gamewithchat.asp")Elseset conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "C:\inetpub\wwwroot\DragonKwest.mdb"set rs = Server.CreateObject("ADODB.recordset")rs.Open "SELECT lsp FROM Characters WHERE ID = " & ID & "", conndo until rs.EOF  for each x in rs.Fields   dim location   location="" & x.value & ""   If newturns=0 then   message=""   Else   message="%20" & newturns & "%20turns%20have%20been%20added%20to%20your%20account"   End If   Response.Cookies("currentpage")="" & location & "?message=" & message & ""   response.redirect("gamewithchat.asp")  next  rs.MoveNext loop rs.closeconn.closeEnd If%>

TIA :)

Link to post
Share on other sites

Join the conversation

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

Guest
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.

Loading...
×
×
  • Create New...