Two Recordsets / Page ???

Results 1 to 2 of 2

Thread: Two Recordsets / Page ???

  1. #1
    Newbie Again Guest

    Default Two Recordsets / Page ???

    I have a modify/edit records page along with other pages that have two record sets with different query strings. It seems that the first one works fine but down the page when the second record set is created, It acts as if .EOF is true and does not do the do while not objrs.EOF loop.<BR><BR>Any answers, suggestions?

  2. #2
    Jason Buck Guest

    Default RE: Two Recordsets / Page ???

    It sounds like you already closed the Connection to the database.<BR><BR>You can open a connection to a database and query it multiple times from different spots on the same page.<BR><BR>IE...<BR><BR>&#060;%<BR>strUserName = request.cookies("WNJCookie")<BR><BR><BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:databaseassoc1yr99.mdb"<BR><BR><BR>dim objconn, objrec, mysql, strStatus, Mytest, strLength<BR>set objconn = server.createobject("ADODB.Connection")<BR><BR>obj Conn.open strConnect<BR><BR>%&#062;<BR><BR>&#060;table&#062; <BR><BR>&#060;tr&#062;<BR>&#060;td&#062;<BR>&#060; b&#062;Attorney&#060;/b&#062;<BR><BR>&#060;%<BR>mysql = "SELECT Grpwiseadbook.UserID, Grpwiseadbook.FirstName, Grpwiseadbook.LastName FROM Grpwiseadbook ;"<BR><BR>set rstemp = objConn.execute(mysql)<BR><BR><BR>response.write "&#060;select name=&#039selattyid&#039&#062;"<BR>strnull = strUserName<BR><BR>If not rstemp.eof then<BR><BR><BR> Do While Not rstemp.EOF<BR>strattyValue = rstemp("UserID")<BR>strattyfn = rstemp("FirstName")<BR>strattyln = rstemp("LastName")<BR> If strnull = strattyValue Then<BR> response.write "&#060;Option Selected value=" & strattyValue & "&#062;" & strattyfn & " " & strattyln & "&#060;/option&#062;"<BR> Else<BR> response.write "&#060;Option value=" & strattyValue & "&#062;" & strattyfn & " " & strattyln & "&#060;/option&#062;"<BR> End if<BR> rstemp.movenext<BR> Loop<BR><BR> <BR>response.write "&#060;/select&#062;"<BR>End if<BR><BR> rstemp.close<BR> <BR><BR><BR>%&#062;<BR><BR><BR><BR>&#060;input type="text" name="AttyID" size="12" value="&#060;%=strUserName%&#062;"&#062;<BR>&#060;/td&#062;&#060;td&#062;&#060;b&#062;Law Area&#060;/b&#062;<BR><BR>&#060;%<BR>mysql = "SELECT Lawarea.Lawareaid, Lawarea.lawarea FROM Lawarea WHERE Lawarea.lawareaid&#062;0;"<BR><BR>set rstemp = objConn.execute(mysql)<BR><BR><BR>response.write "&#060;select name=&#039sellawareaid&#039&#062;"<BR>strnull = 21<BR><BR>If not rstemp.eof then<BR><BR><BR> Do While Not rstemp.EOF<BR>strlawareaValue = rstemp("lawareaid")<BR>strlawarea = rstemp("lawarea")<BR> If strnull = strlawareaValue Then<BR> response.write "&#060;Option Selected value=" & strlawareaValue & "&#062;" & strlawarea & "&#060;/option&#062;"<BR> Else<BR> response.write "&#060;Option value=" & strlawareaValue & "&#062;" & strlawarea & "&#060;/option&#062;"<BR> End if<BR> rstemp.movenext<BR> Loop<BR><BR> <BR>response.write "&#060;/select&#062;"<BR>End if<BR><BR> rstemp.close<BR> <BR><BR><BR>%&#062;<BR>&#060;/td&#062;<BR>&#060;td&#062;&#060;b&#062;Task Type&#060;/b&#062;<BR><BR>&#060;%<BR>mysql = "SELECT Tasktype.tasktypeid, tasktype.tasktype FROM Tasktype WHERE Tasktype.tasktypeid&#062;0;"<BR><BR>set rstemp = objConn.execute(mysql)<BR><BR><BR>response.write "&#060;select name=&#039seltasktypeid&#039&#062;"<BR>strnull = 14<BR><BR>If not rstemp.eof then<BR><BR><BR> Do While Not rstemp.EOF<BR>strtasktypeValue = rstemp("tasktypeid")<BR>strtasktype = rstemp("tasktype")<BR> If strnull = strtasktypeValue Then<BR> response.write "&#060;Option Selected value=" & strtasktypeValue & "&#062;" & strtasktype & "&#060;/option&#062;"<BR> Else<BR> response.write "&#060;Option value=" & strtasktypeValue & "&#062;" & strtasktype & "&#060;/option&#062;"<BR> End if<BR> rstemp.movenext<BR> Loop<BR><BR> <BR>response.write "&#060;/select&#062;"<BR>End if<BR><BR> rstemp.close<BR> <BR><BR><BR>%&#062;<BR>&#060;/td&#062;<BR>&#060;/tr&#062;<BR>&#060;tr&#062;<BR>&#060;td colspan="3"&#062;<BR>&#060;b&#062;Client Name&#060;/b&#062;<BR><BR>&#060;input type="text" name="Cliname" size="70" &#062;<BR>&#060;/td&#062;<BR>&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td&#062;&#060;b&#0 62;Client Number&#060;/b&#062;<BR>&#060;input type="text" name="Clinum" size="5" maxlength="5"&#062;&#060;/td&#062;&#060;td&#062;&#060;b&#062;Client Matter&#060;/b&#062;<BR>&#060;input type="text" name="Climat" size="5" maxlength="5"&#062;&#060;/td&#062;<BR>&#060;/tr&#062;<BR>&#060;tr&#062;&#060;td&#062;&#060;b&#0 62;Estimated Hours&#060;/b&#062;<BR>&#060;input type="text" name="EstHours" size="3" maxlength="3"&#062; to &#060;input type="text" name="EstHours1" size="3" maxlength="3" &#062;&#060;/td&#062;&#060;td&#062;&#060;b&#062;Project Due Date&#060;/b&#062;<BR>&#060;input type="text" name="ProjectDueDate" size="10" maxlength="8" &#062;mm/dd/yy format&#060;/td&#062;<BR>&#060;td&#062;&#060;b&#062;Dead Line&#060;/b&#062;<BR><BR>&#060;%<BR>mysql = "SELECT DeadLine.deadlineid, Deadline.deadlineOpt FROM Deadline WHERE Deadline.deadlineid&#062;0;"<BR><BR>set rstemp = objConn.execute(mysql)<BR><BR><BR>response.write "&#060;select name=&#039seldeadlineid&#039&#062;"<BR>strnull = 1<BR><BR>If not rstemp.eof then<BR><BR><BR> Do While Not rstemp.EOF<BR>strdeadlineValue = rstemp("deadlineid")<BR>strdeadline = rstemp("deadlineopt")<BR> If strnull = strtasktypeValue Then<BR> response.write "&#060;Option Selected value=" & strdeadlineValue & "&#062;" & strdeadline & "&#060;/option&#062;"<BR> Else<BR> response.write "&#060;Option value=" & strdeadlineValue & "&#062;" & strdeadline & "&#060;/option&#062;"<BR> End if<BR> rstemp.movenext<BR> Loop<BR><BR> <BR>response.write "&#060;/select&#062;"<BR>End if<BR><BR> rstemp.close<BR> <BR><BR><BR>%&#062;<BR>&#060;/td&#062;<BR>&#060;/tr&#062;<BR>&#060;tr&#062;<BR>&#060;td&#062;&#060; b&#062;Form of Reply&#060;/b&#062;<BR><BR>&#060;%<BR><BR>mysql = "SELECT FORMOFREPLY.formofreplyID, FORMOFREPLY.formofreply FROM FORMOFREPLY WHERE FORMOFREPLY.formofreplyID&#062;0;"<BR><BR>set rstemp = objConn.execute(mysql)<BR><BR>strnull = 5<BR>response.write "&#060;select name=&#039selFormOfReplyID&#039&#062;"<BR><BR><BR> If not rstemp.eof then<BR><BR><BR> Do While Not rstemp.EOF<BR>strformofreplyValue = rstemp("formofreplyid")<BR>strformofreply = rstemp("formofreply")<BR> If strnull = strformofreplyValue Then<BR> response.write "&#060;Option Selected value=" & strformofreplyValue & "&#062;" & strformofreply & "&#060;/option&#062;"<BR> Else<BR> response.write "&#060;Option value=" & strformofreplyValue & "&#062;" & strformofreply & "&#060;/option&#062;"<BR> End if<BR> rstemp.movenext<BR> Loop<BR><BR> <BR>response.write "&#060;/select&#062;"<BR>End if<BR><BR> rstemp.close<BR><BR>%&#062;<BR>&#060;/td&#062;<BR>&#060;td&#062;&#060;b&#062;Prepare Document/Memo with:&#060;/b&#062;<BR><BR>&#060;%<BR>mysql = "SELECT tblDocFormat.DoctypeID, tblDocFormat.DocumentFormat FROM tblDocFormat WHERE tblDocFormat.DoctypeID&#062;0;"<BR><BR>set rstemp = objConn.execute(mysql)<BR><BR><BR>response.write "&#060;select name=&#039selDocTypeID&#039&#062;"<BR>strnull = 3<BR><BR>If not rstemp.eof then<BR><BR><BR> Do While Not rstemp.EOF<BR>strDocTypeValue = rstemp("DocTypeid")<BR>strDocType = rstemp("DocumentFormat")<BR> If strnull = strDocTypeValue Then<BR> response.write "&#060;Option Selected value=" & strDocTypeValue & "&#062;" & strDocType & "&#060;/option&#062;"<BR> Else<BR> response.write "&#060;Option value=" & strDocTypeValue & "&#062;" & strDocType & "&#060;/option&#062;"<BR> End if<BR> rstemp.movenext<BR> Loop<BR><BR> <BR>response.write "&#060;/select&#062;"<BR>End if<BR><BR> rstemp.close<BR><BR>%&#062;<BR>&#060;/td&#062;<BR>&#060;/tr&#062;<BR>&#060;tr&#062;<BR>&#060;td colspan="3"&#062;<BR>&#060;b&#062;Project Description&#060;/b&#062;<BR><BR>&#060;textarea rows="5" cols="70" name="ProjectDescription"&#062;&#060;/textarea&#062;<BR>&#060;/td&#062;<BR>&#060;/tr&#062;<BR><BR><BR>&#060;/table&#062;<BR><BR>&#060;% <BR>Set rstemp = nothing<BR>objConn.close<BR>Set objConn = nothing<BR><BR>%&#062;<BR><BR>I hope this helps, feel free to contact me if not.<BR><BR>Respectfully,<BR><BR>Jason<BR>webmaste r@wnj.com<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •