Re: appendChunk method resulting in incorrect data
- From: "Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom>
- Date: Fri, 22 Jun 2007 14:58:14 +0100
<everymn@xxxxxxxxx> wrote in message
news:vsim73lq8ec9bdpcg2t3b00pv23e32qtfp@xxxxxxxxxx
I've determined where the extra byte is coming from but I'm not sure
what to do about it. I'm doing this in VBs, and since byte() are not
supported there I'm calling a DLL I made in VB6 to create and modify
them for me. When I do this...
' get a reference an empty byte array
' to read byte arrays from test file
binArr = TestFunctions.GetByteArr()
I'm calling...
Public Function GetByteArr() As Byte()
Dim arr(0) As Byte
GetByteArr = arr
End Function
If I change the dimension to arr(10), then the length of my final
parameter value goes up by 10. What I'm unlear about is that
supposedly the first time you call appendChunk, it's supposed to
initialize the variable. I've tried to dimension it as arr() as Byte,
but then when I do this it tells me I'm trying to use the wrong data
type.
Set param1 = command1.CreateParameter( _
"@binValue", adLongVarBinary, _
adParamInput,_
fileSize+1, binArr)
Is there a more appropriate way to initialize the array that I haven't
tried?
It has been a while since I worked with VB.
I am uncertain of this but I think you are getting 1 more byte because of
the 0 lower bound.
If you do
Dim arr(10) As Byte
that is equivalent to
Dim arr(0 to 10) As Byte
which is 11 elements, not 10.
So you want
Dim arr(1 to 10) As Byte
Dim arr(0 to 9) As Byte
for 10 elements
Stephen Howe
.
- Follow-Ups:
- Re: appendChunk method resulting in incorrect data
- From: everymn
- Re: appendChunk method resulting in incorrect data
- References:
- appendChunk method resulting in incorrect data
- From: everymn
- Re: appendChunk method resulting in incorrect data
- From: everymn
- appendChunk method resulting in incorrect data
- Prev by Date: Re: Rounding error while saving a recordset as XML
- Next by Date: Re: appendChunk method resulting in incorrect data
- Previous by thread: Re: appendChunk method resulting in incorrect data
- Next by thread: Re: appendChunk method resulting in incorrect data
- Index(es):
Relevant Pages
|
|