By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Need urgent help in solving this recordset error

P: 4
Let's say I haf 3 project that I wan to list, each project should have 1 value assign to it, but if i remove 1 of the value for 1 of the project, and i tried to list all 3 projects, I get this error:
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

This is my code:
Expand|Select|Wrap|Line Numbers
  1. <%
  2.     call OpenDB()
  3.  
  4.     set rs = Server.CreateObject("ADODB.recordset")
  5.     sql="SELECT * FROM project ORDER BY id"
  6.     rs.Open sql, dbConn
  7.  
  8.     Set li = Server.CreateObject("ADODB.Recordset")
  9.     licheck= "SELECT * FROM usergroup WHERE gpname='"& Request.Cookies("UsernameCookie") &"'" 
  10.     li.Open licheck, dbConn
  11.  
  12.     Set lili = Server.CreateObject("ADODB.Recordset")
  13.     licheckproj= "SELECT * FROM project WHERE id="&li("projectid")&"" 
  14.     lili.Open licheckproj, dbConn
  15.  
  16.     If Request.Cookies("UsernameCookie")="" then
  17.     Response.Write("<center>Please Login to check the current project that you are registered with!</center><br>")
  18.  
  19.     do while not rs.EOF 
  20.  
  21.     Response.Write("<div class=""post"">")
  22.     Response.Write("<h2 class=""title""><span>"&rs("pjname")&"</span></h2>")
  23.     Response.Write("<div class=""story"">")
  24.     Response.Write("<table width=""80%""><td>"&rs("pjdesc")&"</td></table>")
  25.     Response.Write("<div class=""meta"">")
  26.     Response.Write("</div>")
  27.     Response.Write("</div>")
  28.     Response.Write("</div>")
  29.  
  30.     rs.MoveNext
  31.     loop
  32.     rs.close
  33.     set rs = nothing
  34.  
  35.     elseif not Request.Cookies("UsernameCookie")="" and Request.Cookies("priv") = "1" then
  36.     Response.Write("<font color=red size=""2""><b>Welcome<font color=black size=""3""> "&li("gpname")&"</font>, you are currently registered under <font color=black size=""3"">"&lili("pjname")&"</font> <br>For more information about your project, click <a href=""index.asp?p=loginprojstatus"">here</a>.<br>To make changes to your group, click <a href=""index.asp?p=changeproject"">here</a>. </b></font></br>")
  37.  
  38.     set rss = Server.CreateObject("ADODB.recordset")
  39.     students="SELECT COUNT(gpname) AS countproject FROM usergroup Where classid = "&li("classid")&" GROUP BY projectid"
  40.     rss.Open students, dbConn
  41.  
  42.     set rsss = Server.CreateObject("ADODB.recordset")
  43.     studentss = "SELECT * from class WHERE "&li("classid")&" = id"
  44.     rsss.Open studentss,dbConn
  45.  
  46.     do while not rs.EOF
  47.  
  48.     Response.Write("<div class=""post"">")
  49.     Response.Write("<h2 class=""title""><span>"&rs("pjname")&"</span></h2>")
  50.     Response.Write("<div class=""story"">")
  51.     Response.Write("<table width=""80%""><td>"&rs("pjdesc")&"</td></table>")
  52.     Response.Write("<div class=""meta"">")
  53.     Response.Write("</div>")
  54.     Response.Write("</div>")
  55.     if not (rss.EOF or rss.BOF) then 
  56.     Response.Write("<br><table width=""80%""><td>Number of Registered Groups from "&rsss("classes")&" : "&rss("countproject")&"</td>    </table>")
  57.     Response.Write("</div>")
  58.     else 
  59.     Response.Write("<br><table width=""80%""><td>Number of Registered Groups from "&rsss("classes")&" : 0</td>    </table>")
  60.     Response.Write("</div>")
  61.     end if
  62.     rss.MoveNext
  63.     rs.MoveNext
  64.     loop
  65.     rss.close
  66.     set rss = nothing
  67.     rs.close
  68.     set rs = nothing
  69.  
  70.  
  71.     else 
  72.  
  73.     Response.Write("<font color=red size=""2""><b>Welcome "&li("gpname")&", <br>You are currently administrator</font></b></br>")
  74.  
  75.     do while not rs.EOF 
  76.  
  77.     Response.Write("<div class=""post"">")
  78.     Response.Write("<h2 class=""title""><span>"&rs("pjname")&"</span></h2>")
  79.     Response.Write("<div class=""story"">")
  80.     Response.Write("<table width=""80%""><td>"&rs("pjdesc")&"</td></table>")
  81.     Response.Write("<div class=""meta"">")
  82.     Response.Write("</div>")
  83.     Response.Write("</div>")
  84.     Response.Write("</div>")
  85.  
  86.     rs.MoveNext
  87.     loop
  88.     rs.close
  89.     set rs = nothing
  90.  
  91.     end if
  92.  
  93. %>
Jan 1 '08 #1
Share this Question
Share on Google+
1 Reply


P: 4
Nvm...I have solve that stupid error...
Jan 2 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.