What to use for ADO parameter type and size



Running a parameterized query that loops through
a variant array holding integer values. These values may go up to something like 123456789012345, so beyond
the Integer or Long datatype.

The code will be like this:

----------------------------------------------------------------

Dim cmdADO As ADODB.Command
Dim oParam As ADODB.Parameter

Set cmdADO = New ADODB.Command
Set oParam = New ADODB.Parameter

With cmdADO
.ActiveConnection = ADOConn
.CommandText = strSQL3 & "?"
.CommandType = adCmdText
End With

With oParam
.Type = adChar
.Size = 15
.Direction = adParamInput
End With

cmdADO.Parameters.Append oParam

For i = 0 To UBound(arr2)

cmdADO.Parameters(0).Value = arr2(i, 0) 'this is a variant array

Set rs = cmdADO.Execute()
----------------------------------------------------------

How should I define the properties of oParam?
The coding as above works, but somehow doesn't look quite right.
Any suggestions/advice?


RBS


.



Relevant Pages