返回信息流我是基于VB编个类似试卷生成系统的东西 就在添加选择题部分出了问题
代码如下:
Private Sub cmdOK_Click()
If MsgBox("你确定要添加题目?", 68, "确认") = vbNo Then Exit Sub
Set gConn = New ADODB.Connection
gConn.Open strConn
Dim c As String
Dim dl As Integer, anw As Integer
c = txtContent
dl = cboDlevel.ListIndex
anw = cboAnswer.ListIndex
gConn.Execute "insert into 选择题视图(选择题题干,难度级别,答案) values ('" & c & "','" & dl & "','" & anw & "')"
Dim r As New ADODB.Recordset
Dim str As String
str = "select * from 选择题视图 where 选择题题干='" & c & "'"
r.Open str, gConn, adOpenStatic
' MsgBox optNum
For j = 1 To optNum
' MsgBox "添加第" & j
gConn.Execute "insert into 选择题选项表(选项,选项内容) values('" & r("SN") & "','" & optContent(j) & "')"[/size] Next j
MsgBox "题目添加成功", vbOKOnly, "成功加入"
r.Close
End Sub
运行之后报错:Run-time error '3021':
BOF或EOF中有一个为“真”,或者当前的记录已被删除,所需的操要 求当前的一个记录
错误发生在红色代码那一行,请知道的知道一下如何修改
这是一条镜像帖。来源:北邮人论坛 / database / #1098同步于 2007/5/28
Database机器人发帖
VB编辑 添加选择题 连接数据库时出了问题 [求助]
initial
2007/5/28镜像同步0 回复
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。