adLongParam refers to a parameter attribute and it is one of the
requirements for AppendChunk method. I apologize if that wasn't clear. A
parameter of type adLongVarChar indeed has this attribute set. I've tried
simply setting the value property but it fails and that is why I thought
that it was necessary to use AppendChunk method. I wonder if it is a
shortcoming of the provider that I am using. Of course you're more than
welcome to critique the following excerpt:
Set objCmd = CreateObject("ADODB.Command")
If m_Connection.State = adStateClosed Then
m_Connection.Open
End If
With objCmd
.ActiveConnection = m_Connection
.CommandType = adCmdText
.CommandText = "INSERT INTO HISTORY (HISTORYID, LONGNOTES) VALUES (?,
?)"
For i = 0 To UBound(arrFields)
If (.Parameters(i).Attributes And adParamLong) = adParamLong Then
.Parameters(i).AppendChunk arrFields(i)
Else
.Parameters(i) = m_Fields.Item(arrFields(i))
End If
Next
.Execute
End With
UPDATE:
I found out instead of using the provider-provided parameter information
(via .Parameters(i)), manually constructing the parameters via
.CreateParameter coupled with .Parameters.Append solves the issue. For some
reason, even though, the provider-returned information seems to be
identical, it does not like it when I actually use it to insert/update.
Note that I am able to use the Value property as you suggested this way.
So, I am wondering, when do you use AppendChunk on a parameter? For a
binary data?(image perhaps?)
your
the
incorrect.