I ve been trying to dynamically add to a Recordset but I am unable to do so. The .addnew function of a adodb.recordset seems to not allow just any type of array to be passed to it s fieldvalues, values parameters. For example if after setting up your recordset with the appropriate field values you say:
FieldsArray = array("field1", "field2")
ValuesArray = array("val1","val2")
rs.AddNew FieldsArray, ValuesArray
This works!! But if you instead write
Dim fieldsarray(0 To 1) As String
FieldsArray(0) = "field1"
FieldsArray(1) = "field2"
ValuesArray = array("val1","val2")
rs.AddNew FieldsArray, ValuesArray
It Fails?!?! (More specifically [Run-Time error 3001 : Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another])
为什么有人在新的参数中宣布实地阵列? 我是否能够让后者工作?