|
运行时提示,实时错误'91',对象变量或with块变量未设置。我应该如何修改,请高手指点
Private Function GetQID(ByVal QType As Long, ByRef Score As Single) As Long
On Error Resume Next
Dim dbrs As ADODB.Recordset
Set dbrs = GetDBRS(QType) '获取题型为qType的数据集
dbrs.Open '打开数据集
……
dbrs.Close
…… '函数返回题目编号
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Function GetDBRS(ByVal Q As Long) As Object '获取类型为Q的数据集
On Error Resume Next
Select Case Q
Case 1
GetDBRS = DataEnv.rsFillingQ ////运行出错语句
Case 2
GetDBRS = DataEnv.rsRorWQ
Case 3
GetDBRS = DataEnv.rsSingleSelQ
End Select
End Function
|
|