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

Movenext

Status
Not open for further replies.

johnshutt

Technical User
Apr 11, 2002
6
0
0
GB
I have a recordset full of questions. what i am tryin to do is display the answers in a form and when the user clicks the submit button it passes the value back to the original page and increments the recordset by 1, thus displayin the next question. heres my code. a bit simple but works all the same, NE Ideas??

dim Conn, Questions, Conn2, Answers

Set Conn = Server.CreateObject("ADODB.Connection")
Set Questions = Server.CreateObject("ADODB.Recordset")

Set Conn2 = Server.CreateObject("ADODB.Connection")
Set Answers = Server.CreateObject("ADODB.Recordset")

Conn.Open "Provider =Microsoft.Jet.OLEDB.4.0;" &_
"Data Source = C:\Inetpub\ &_
"Persist Security Info=False"

strSQL = "SELECT * FROM questions"

Questions.Open strSQL, Conn, adOpenDynamic

'Questions.MoveFirst

Conn2.Open "Provider =Microsoft.Jet.OLEDB.4.0;" &_
"Data Source = C:\Inetpub\ &_
"Persist Security Info=False"

strSQL = "SELECT * FROM student"

Answers.Open strSQL, Conn, adOpenDynamic
'Answers.MoveFirst

%>
<H2>You are currently on question number <%Response.Write Questions(&quot;Question Number&quot;)%><BR><BR><BR>

<%Response.Write Questions(&quot;Question&quot;)%><BR>

<form action=&quot;test.asp&quot; method=&quot;post&quot;>
<p><input TYPE=&quot;radio&quot; NAME=&quot;Answer&quot; VALUE=&quot;A&quot;><%Response.Write Questions(&quot;Answer A&quot;)%></p>
<p><input TYPE=&quot;radio&quot; NAME=&quot;Answer&quot; VALUE=&quot;B&quot;><%Response.Write Questions(&quot;Answer B&quot;)%></p>
<p><input TYPE=&quot;radio&quot; NAME=&quot;Answer&quot; VALUE=&quot;C&quot;><%Response.Write Questions(&quot;Answer C&quot;)%></p>
<p><input TYPE=&quot;radio&quot; NAME=&quot;Answer&quot; VALUE=&quot;D&quot;><%Response.Write Questions(&quot;Answer D&quot;)%></p>
<input type=&quot;submit&quot; Value =&quot;Forwards&quot;<%Questions.MoveNext%>>
</form>
 
[tt]May we ask what your question about the code is, or did I miss it?[/tt]
[pc3]
[thumbsup2]
 
Check this thread:
thread333-249800
You will have to modify the PageCount property = 1

Hope this is what you meant
Regards,
Durug
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top