Re: odbc wrapper

new topic     » goto parent     » topic index » view thread      » older message » newer message

Mario Steele wrote:
> 
> George Walters wrote:
> > 
> > 
> > Matt, I think there is a bug in function getData. I was losing a character
> > in a data field(a very long data field) about every 256 chars. The data
> > field
> > was an invoice text field that was a page or 2 of characters. I changed this
> >
> > line below (removed the "-1" and the character loss went away. Could you
> > check
> > what I did(a shot in the dark) and make sure it was a correct change. I am
> > not at all sure of what I did.
> > 
> > }}}
<eucode>
> >                     -- have to call repeatedly, since data was too big for
> >                     the
> >                     -- buffer
> >                     while len > mylen do
> >                         data[row][i] &= peek( { ptr1, mylen }
> >                         )--<<<<<<<<<<<<<<<<<<< removed the -1 which was mylen-1
> >                         ok = c_func( SQLGetData, { hs, i, SQL_C_DEFAULT,
> >                             ptr1, mylen, ptr2 } )
> >                         len = peek4s( ptr2 )
> > 
> >                     end while
> > </eucode>
{{{

> > 
> 
> That is more then correct.  I think Matt was attempting to account for the
> 0 byte terminator, that comes from most C Style strings.  But in doing so,
> He forgot that ODBC doesn't account for the 0 Byte terminator, when it returns
> the length of the String in memory.

Undoubtedly that's exactly what I did.  I'll correct this for the next
version.

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu