I would start with the select statement. Run it directly in Access to ensure
that you are getting all your records returned.
If that's OK, look at your for..next statement. More specifically, your If
statement within it. Comment it out and just response.write whatever is in the
recordset.
Mark
kala12_2002 <[EMAIL PROTECTED]> wrote:
I have developed a small quiz code with access as the backend.I have a
table question with columns qid wuestion q1 q2 q3(choices) and
correctanswer.for the foirst question itis showing all the choices ie
q1 q2 q3 but when i come to the next question its skipping q1 and
showing only the choices q2 and q3. i am stuck in this .plz help.
here's the code
<%@ language="vbscript"%>
<!--#include virtual ="/adovbs.inc"-->
<body>
<%
session("corr1")
selchoice=request.form("myname")
correct1=request.form("correct")
curpage=request.form("cur")
if selchoice=correct1 and not curpage="" then
session("corr1")=session("corr1")+1
response.write("<br>"&correct1)
response.write("<br>"&selchoice)
response.write("the Score is "&session("corr1"))
end if
if curpage="" then
curpage=1
response.write("<br>"&"hi")
corr=0
wro=0
end if
%>
<%
if curpage<=2 then
Dim Conn, dbPath
Set Conn = Server.CreateObject("ADODB.Connection")
dbPath = "c:\dsn\db2.mdb"
Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&dbPath
set Rs=server.createobject("adodb.recordset")
RS.open "SELECT * FROM question WHERE qid=" & curpage ,Conn
SQL = "SELECT * FROM question WHERE qid=" & curpage
Response.Write "SQL is " & SQL & "<BR>" & vbNewLine
response.write(curpage)
%>
<form method="post" action="quiz.asp">
<%
response.write rs("qid")%>.<br>
<% response.write rs("question")%>
<Select name="myname">
<%
for i=2 to 4 step 1
thisfield=trim(RS(i))
if thisfield<>"" then
response.write "<option>"&rs(i)&"</option>"
end if
next %>
</select>
<input type="hidden" name="correct" value="<%=rs("correctanswer")%>">
<input type="hidden" name="cur" value="<%=curpage+1%>">
<input type="submit" name="click">
</form>
<%end if%>
</body>
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/