
Getting Error Message when using AppendChunk with Parameter Object
Hi,
To use parameters, first you need to define them. If you
have parameters in SP, it does not mean that you can use
them from Parameters collection withou defining. Also
Parameters collection and names in SP can be different.
ADO will match them by index.
Here is an small example of using parameters. It does not
use AppendChanck. but will give you general idea how to
provide that
Dim loConnection As ADODB.Connection
Dim loCommand As ADODB.Command
Dim loParameter As ADODB.Parameter
Dim lnFirstOutput As Long
Dim lnSecondOutput As Long
Set loConnection = New ADODB.Connection
loConnection.Open "DSN=Test;Database=pubs3;UID=FRI;PWD=", "
FRI", "RAISON"
Set loCommand = New ADODB.Command
Set loCommand.ActiveConnection = loConnection
loCommand.CommandText = "sp_foo"
loCommand.CommandType = adCmdStoredProc
Set loParameter = loCommand.CreateParameter("MyOutput",
adInteger, adParamReturnValue)
loCommand.Parameters.Append loParameter
Set loParameter = loCommand.CreateParameter("First",
adInteger, adParamInput, , 100)
loCommand.Parameters.Append loParameter
loCommand.Execute
Debug.Print loCommand.Parameters("MyOutput")
Set loParameter = Nothing
Set loCommand = Nothing
Val
Quote:
>-----Original Message-----
>Hello,
>I got the following message when using AppendChunk Method
of the Parameter
>Object:
>Microsoft ODBC SQL Server Driver String Data, Right
Truncation
>I have a table with two TEXT fields in a SQL Server 2000
DB. I am trying to
>use an SP to update the two columns:
>With cmdTemp
> .ActiveConnection = conTemp
> .CommandText = "spi_nntparticle"
> .CommandType = adCmdStoredProc
> .Execute
>End With
>I got the error as soon as execute is called. I have also
tried it with
>sending the data in chunks of say 4000 but again as soon
as I call the
>Execute it gets the same error. It is fine when it is
small sizes like 2000
Quote:
>but when I hit say a 53000 length it gets the error.
>Any help will be greatly appreciated.
>Thanks,
>Ken
>.