vb 数组参数问题
--------------------编程问答-------------------- Public Function Update(byval rstGoodsCode() As ADODB.Recordset)--------------------编程问答-------------------- 楼上的来搞笑的吗
楼主的问题是没初始化数组
用函数前 redim就行了 --------------------编程问答-------------------- Update(mrstReturnGoodsCode())'去掉红色的括号 --------------------编程问答--------------------
既然外部已经用ADO对象定义了mrstReturnGoodsCode数组,函数内部就不能再用ADO对象定义数组了,只能用关键字ParamArray定义变体数组:
'先引用ADO对象
Option Explicit
Private mrstReturnGoodsCode() As ADODB.Recordset
Public Function Update(ParamArray rstGoodsCode() As Variant)
'Set rstGoodsCode() = mrstReturnGoodsCode()
MsgBox ("ssdfsdfg")
End Function
Private Sub Command1_Click()
ReDim mrstReturnGoodsCode(100)
Update (mrstReturnGoodsCode())
End Sub
补充:VB , COM/DCOM/COM+