Re: appendChunk method resulting in incorrect data



On Mon, 25 Jun 2007 20:47:03 +0100, "Stephen Howe"
<stephenPOINThoweATtns-globalPOINTcom> wrote:

Should this work?

Not sure. I know it works for SP's, not sure it works for adhoc commands (I
cannot remember whether I have tried it)
But then so far you have not said what your provider is.

Try changing your example to this, just for final checks

Command1.CommandText = strSQL
Command1.CommandType = adCmdText
Command1.Prepared = true
Command1.Parameters.Refresh

Are the parameters filled in?

Stephen Howe



It looks like we might have a problem here. I just tried this against
SQL Server, and the refresh isn't even necessary. The parameter
objects are retrieved immediately after assigning the SQL command to
CommandText. I gather it invokes Refresh on it's own at that point.

On a happier note I did get a solution to the initial problem I posted
about. It seems that by declaring the source array at the time the
param was created, then it acted as if this was the initial call to
AppendChunk, so the first time AppendChunk was actually called it
failed to initialize the array, leading to the extra byte. By simply
omitting the source array name when create param was called, it made
it work as expected.

Thanks for the help!
Eric
.