计算机毕业设计介绍:
(3)判断题
此模块可以添加、修改和删除判断题内容信息。包括题目内容和正确答案。
以下是引用片段: 其关键代码如下: Private Sub btnSave_Click() Dim strSelect As String '判断选择题答案 Dim i As Long For i = 0 To 1 If Me.Option1(i).Value = True Then strSelect = strSelect + Me.Option1(i).Caption End If Next If idkey > 0 Then '修改选择题 Call Exec_SqL("update JudgeProblem set title='" & Me.txtTmnr.Text & "',Answer='" & strSelect & "' where id=" & idkey & " ") Else '添加选择题 Call Exec_SqL("insert into JudgeProblem values('" & Me.txtTmnr.Text & "','" & strSelect & "')") End If Unload Me End Sub Private Sub Form_Load() '显示当前的选择题内容 Me.btnDel.Enabled = False If idkey > 0 Then Dim tmprs As New ADODB.Recordset Set tmprs = ExecSql("select * from JudgeProblem where id=" & idkey & "") With tmprs If .RecordCount > 0 Then Me.txtTmnr.Text = .Fields("Title").Value Dim i As Long For i = 0 To 1 If InStr(1, .Fields("Answer").Value, Me.Option1(i).Caption) > 0 Then Me.Option1(i).Value = True End If Next Me.btnDel.Enabled = True End If End With End If If boolReadOnly Then Me.btnDel.Enabled = False Me.btnSave.Enabled = False End If End Sub
|
〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
第8页为计算机毕业论文部分......