我是 Visual Basic 6 的新手,我正在尝试执行存储过程并将结果放入文本字段变量中。
下面的代码显示此错误:错误 91“对象变量或未设置块变量”运行时错误
Dim auxInfo As rdoResultset
Dim Cone As ADODB.Connection
SQL = "EXEC [mybase].[dbo].[myStoredProcedure] '" & var1 & "', '" & var2 & "','" & var3 & "'"
Set auxInfo = Cone.Execute(SQL)
myTextField.Text = Trim(auxInfo("fistColumn"))
auxInfo.Close
如果我更改以下内容:
Set auxInfo = Cone.Execute(SQL)
进入
Set auxInfo = UAN.OpenResultset(SQL, rdOpenDynamic, rdConcurValues, 0)
'with UAN I call the funcion that connects to my database. The connection works, I've tested it.
我收到一个新错误:错误 13 类型不匹配
请告诉我我做错了什么?
谢谢!!