Hi again guys.
I have two db's as I found you can't have two tables in one db. However, each set of SQL works the same ( as far as I can tell). Essentially I call one record from, say, the lessons db and transfer the colukmns into label.texts for display on the page, sorry, view.
However, when I do the same thing with the studies db it reads the correct information but when it goes to to next record it prints it over the top of the first one and so on ad infinitum.
Here are the codes for the two sections....
Sub GetNextRecord()
Dim DBCursor As Cursor
LessonSQLText="SELECT * FROM Lesson WHERE board LIKE '" & BoardText & "' AND level LIKE '" & LevelText & "' ORDER BY ID ASC "
DBCursor=SQLLessons.ExecQuery(LessonSQLText)
lblScore.Text="Score: " & Score
lblQuestion.Text="Question: " & i
DBCursor.Position=i
y = DBCursor.RowCount
If DBCursor.Position <> y Then
ID=i
lblQuestion_Text.Text = " Q: " & DBCursor.GetString("question")
lblAnswerA.Text = " A: " & DBCursor.GetString("answerA")
lblAnswerB.Text = " B: " & DBCursor.GetString("answerB")
lblAnswerC.Text = " C: " & DBCursor.GetString("answerC")
lblAnswerD.Text = " D: " & DBCursor.GetString("answerD")
If DBCursor.GetString("answwered")= False Then
fldAnswered = False
ImageView2.Visible = False
ImageView3.Visible = True
Else
fldAnswered = True
ImageView3.Visible = False
ImageView2.Visible = True
End If
CorrectAnswer=DBCursor.GetString("answer")
i=DBCursor+1
DBCursor.Close
Else
Msgbox("End of Questions with a score of '" & Score, "")
DBCursor.Close
End If
End Sub
and the "wrong" un....
Sub GetNextRecord()
Dim DBCursor As Cursor
LessonSQLText="SELECT * FROM Lesson WHERE board LIKE '" & BoardText & "' AND level LIKE '" & LevelText & "' ORDER BY ID ASC "
DBCursor=SQLLessons.ExecQuery(LessonSQLText)
lblScore.Text="Score: " & Score
lblQuestion.Text="Question: " & i
DBCursor.Position=i
y = DBCursor.RowCount
If DBCursor.Position <> y Then
ID=i
lblQuestion_Text.Text = " Q: " & DBCursor.GetString("question")
lblAnswerA.Text = " A: " & DBCursor.GetString("answerA")
lblAnswerB.Text = " B: " & DBCursor.GetString("answerB")
lblAnswerC.Text = " C: " & DBCursor.GetString("answerC")
lblAnswerD.Text = " D: " & DBCursor.GetString("answerD")
If DBCursor.GetString("answwered")= False Then
fldAnswered = False
ImageView2.Visible = False
ImageView3.Visible = True
Else
fldAnswered = True
ImageView3.Visible = False
ImageView2.Visible = True
End If
CorrectAnswer=DBCursor.GetString("answer")
i=DBCursor+1
DBCursor.Close
Else
Msgbox("End of Questions with a score of '" & Score, "")
DBCursor.Close
End If
End Sub
:sign0085: please
I have two db's as I found you can't have two tables in one db. However, each set of SQL works the same ( as far as I can tell). Essentially I call one record from, say, the lessons db and transfer the colukmns into label.texts for display on the page, sorry, view.
However, when I do the same thing with the studies db it reads the correct information but when it goes to to next record it prints it over the top of the first one and so on ad infinitum.
Here are the codes for the two sections....
Sub GetNextRecord()
Dim DBCursor As Cursor
LessonSQLText="SELECT * FROM Lesson WHERE board LIKE '" & BoardText & "' AND level LIKE '" & LevelText & "' ORDER BY ID ASC "
DBCursor=SQLLessons.ExecQuery(LessonSQLText)
lblScore.Text="Score: " & Score
lblQuestion.Text="Question: " & i
DBCursor.Position=i
y = DBCursor.RowCount
If DBCursor.Position <> y Then
ID=i
lblQuestion_Text.Text = " Q: " & DBCursor.GetString("question")
lblAnswerA.Text = " A: " & DBCursor.GetString("answerA")
lblAnswerB.Text = " B: " & DBCursor.GetString("answerB")
lblAnswerC.Text = " C: " & DBCursor.GetString("answerC")
lblAnswerD.Text = " D: " & DBCursor.GetString("answerD")
If DBCursor.GetString("answwered")= False Then
fldAnswered = False
ImageView2.Visible = False
ImageView3.Visible = True
Else
fldAnswered = True
ImageView3.Visible = False
ImageView2.Visible = True
End If
CorrectAnswer=DBCursor.GetString("answer")
i=DBCursor+1
DBCursor.Close
Else
Msgbox("End of Questions with a score of '" & Score, "")
DBCursor.Close
End If
End Sub
and the "wrong" un....
Sub GetNextRecord()
Dim DBCursor As Cursor
LessonSQLText="SELECT * FROM Lesson WHERE board LIKE '" & BoardText & "' AND level LIKE '" & LevelText & "' ORDER BY ID ASC "
DBCursor=SQLLessons.ExecQuery(LessonSQLText)
lblScore.Text="Score: " & Score
lblQuestion.Text="Question: " & i
DBCursor.Position=i
y = DBCursor.RowCount
If DBCursor.Position <> y Then
ID=i
lblQuestion_Text.Text = " Q: " & DBCursor.GetString("question")
lblAnswerA.Text = " A: " & DBCursor.GetString("answerA")
lblAnswerB.Text = " B: " & DBCursor.GetString("answerB")
lblAnswerC.Text = " C: " & DBCursor.GetString("answerC")
lblAnswerD.Text = " D: " & DBCursor.GetString("answerD")
If DBCursor.GetString("answwered")= False Then
fldAnswered = False
ImageView2.Visible = False
ImageView3.Visible = True
Else
fldAnswered = True
ImageView3.Visible = False
ImageView2.Visible = True
End If
CorrectAnswer=DBCursor.GetString("answer")
i=DBCursor+1
DBCursor.Close
Else
Msgbox("End of Questions with a score of '" & Score, "")
DBCursor.Close
End If
End Sub
:sign0085: please