Getting Error Message when using AppendChunk with Parameter Object 
Author Message
 Getting Error Message when using AppendChunk with Parameter Object

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
but when I hit say a 53000 length it gets the error.

Any help will be greatly appreciated.
Thanks,
Ken



Sun, 02 May 2004 05:33:21 GMT  
 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

- Show quoted text -

Quote:
>but when I hit say a 53000 length it gets the error.

>Any help will be greatly appreciated.
>Thanks,
>Ken

>.



Sun, 02 May 2004 21:38:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting error message when using SQL for data source in ADOC

2. Using AppendChunk to store OLE objects?

3. error message when using ie object

4. Handling Messages from Stored Procedure Using ADO Error Object

5. Error when using a parameter object to set a datetime value

6. Error when using RecordSet.Update after AppendChunk

7. Getting Invalid Logon parameters message!!

8. Parameter Error Message

9. How to keep web database from getting reverse-engineered using url parameters

10. expects parameters error message

11. How to keep web database from getting reverse-engineered using url parameters

12. Getting text source of message using VB/VBA

 

 
Powered by phpBB® Forum Software