What to use for ADO parameter type and size
- From: "RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx>
- Date: Fri, 27 Jul 2007 15:32:35 +0100
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
.
- Follow-Ups:
- Re: What to use for ADO parameter type and size
- From: Bob Barrows [MVP]
- Re: What to use for ADO parameter type and size
- Prev by Date: Re: number field comes in as integer
- Next by Date: Re: number field comes in as integer
- Previous by thread: Re: number field comes in as integer
- Next by thread: Re: What to use for ADO parameter type and size
- Index(es):
Relevant Pages
|
|