提示vb 实时错误‘91’对象变量或 With 块变量没有设置
Private Sub Form_Load()Dim rst As ADODB.Recordset
Dim strItem As String
'初始化ComboBox
SQL = " select 用户ID,用户名称 from 用户信息表 order by 用户ID"
Set rst = SelectSQL(SQL, msg)
If rst.RecordCount > 0 Then
Do While Not rst.EOF
strItem = rst.Fields(0) & " " & rst.Fields(1)
CboName.AddItem (strItem)
rst.MoveNext
Loop
rst.Close
CboName.ListIndex = 0
Else
MsgBox ("请先创建用户信息!")
CmdOK.Enabled = False
Exit Sub
End If
End Sub
运行到If rst.RecordCount > 0 Then出现提示vb 实时错误‘91’对象变量或 With 块变量没有设置
望解决,不胜感激