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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loops are driving me loopy

Status
Not open for further replies.

biry

Technical User
Nov 5, 2004
127
CA
Any ideas why i can't get rid of this error of Microsoft VBScript runtime error '800a01a8' Object required: '' in this area of the script:

Code:
	RS.Open sql2, conn
	Do While Not RS.EOF
      response.write "<li>"

	   if session("b2bExpire")<now() or isNull(session("b2bExpire")) and session("proExpire")<now() or isNull(session("proExpire")) then
      %><a href="join.asp"><%=rs("companyName")%></a><hr />
	  <% else %>
	  	<a href="javascript:void(0);" onclick="window.open('canExchangeInfo.asp?page=<%=rs("companyID")%>&cid=<%=rs("cid")%>', '', 'width=800, height=600, location=no, menubar=no, scrollbars=yes, status=no');"><%= rs("companyName")%> : <%=rs("symbol") %></a><br />
	  <% end if

     sql2="select * from sedarCompanyContact where companyID= '" & rs("companyID") & "'"

      rs2.open sql2, conn
       do while not rs2.eof
        response.write "<table width='100%'><tr><td align=left><b>" & rs2("title") & "</b>:</td><td width='20%'>" & rs2("firstname") & " " & rs2("lastname") & "</td><td width=""4%"" align=""left""><a href=sedarBodDir.asp?fname=" & rs2("firstname") &"&lname=" &  rs2("lastname") &"&nsearch=t><img src=images/only.gif border=""0"" width=""40"" height=""17"" alt=""click for this officer only""></a></td></tr></table>"
        rs2.movenext
       loop
     response.write "<hr />"
       rs2.close
	 rs.moveNext
	loop

	rs.close
	response.write "<center><a href=#>top</a></center>"

 
RS /rs didn't matter, i forgot to conn EXECUTE the sql, all is fine now, thanks
 
What line of code did the error occur on (and clarify what that line number contains)?

Did you properly set your recordset?
Set rs = Server.CreateVariables("ADODB.RecordSet")

Earnie Eng
 
Out of curiousity, why are you using recordset calls inside a loop for a recordset? Dynamically generating recordset is kinda bad for memory and performance, why not just use one SQL statement and pull it all back one time?

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top