Re: appendChunk method resulting in incorrect data




<everymn@xxxxxxxxx> wrote in message
news:7ccp73lvl1v6n32cjnh1juhueih86nfms1@xxxxxxxxxx
Steven,
Correct, my bad, when I dim arr(10) I was ending up with 11 extra
bytes in the data. I actually don't want any bytes though.

I'm just returning this array for use reading a binary file and then
saving that data to an ADO parameter using appendChunk. So I have two
dilemma's, first why does the append function flip out and say that
the data type is wrong when I have the DLL return arr() as byte?

Second even if I do return it as arr(0) as byte, why isn't appendChunk
initialiing the array and writing over that first 0 the first time I
call it? As a result of this when I write say 500 bytes I end up with
501 in the data source, and an invalid file.

Thanks
Eric


Try adFldLong instead of adLongVarBinary.

You might find this of interest...
"If you wish to create your parameters using the CreateParameter method, but
you're having trouble matching datatypes or sizes, then the simplest fix is
to temporarily call the Refresh method and examine the Parameters
collection. You can do this by looping through the collection, or by using
the Locals window in Visual Basic. You can then copy the values that ADO has
used and amend your code accordingly. Don't forget to remove the Refresh
once you've sorted out your parameters - leaving it in will cause a
performance penalty."





.