0
我已经在VBScript中编写了我的代码。我在下面显示的代码的特定部分中出现错误。Microsoft VBScript运行时错误
[ActiveX Script Task] Error: User script threw an exception: Error Code: 0
Error Source= Microsoft VBScript runtime error
Error Description: Object required: 'REGroupSBUOps'Error on Line 85
'Declaring and connection string statements
strREGroupSBUOps ="sp_CPVarianceOpsReport6"
Set REGroupSBUOps = oDBCon.Execute(strREGroupSBUOps)
Dim arr()
ReDim arr(6)
Dim i
arr(0) = "REGroupSBUOps"
arr(1) = "DandBSBUOps"
arr(2) = "Tristate/Central/EastSBUOps"
arr(3) = "WestSBUOps"
arr(4) = "EastSBUOps"
arr(5) = "UKSBUOps"
If Not (arr(i).EOF) Then ' <--error on this line
'followed by other statements
'arr'是一个字符串数组。字符串没有“EOF”属性。 'arr(i).EOF'应该做什么?你想用这个陈述来检查什么? –
strREGroupSBUOps分配有存储过程,REGroupSBUOps是sp的结果集。检查数组和条件中的结果集名称。 –
一个字符串不会奇迹般地变成一个变量,除非您使用[** Eval'](https://msdn.microsoft.com/zh-cn/library/0z5x4094.aspx),我强烈建议**。此外,这看起来像一个[X-Y问题](http://mywiki.wooledge.org/XyProblem)给我。为什么你不能简单地使用变量?请解释您尝试解决的实际问题,而不是您认为的解决方案。 –