Thread: Odbc driver
Byron, Postgres 6.3.2, Odbc driver 6.40.0004 I get this 'Access violation at address xxxxxxx in module 'PSQLODBC.DLL'. Read of address yyyyyyyy' calling SQLGetData( hstmt, FieldNo, SQL_BINARY, SQLPOINTER( @i), 0, @iv); note the 5th parameter -> 0 over a TEXT field with sizes of 4000 or more bytes. if I try it with small fields (3000 or so bytes) there is no problem. ok, I tracked it down and it seems to work until iv=4099, when it must return 4100, boom ! I wonder why a text saved by Notepad is 4183 bytes and this same text within Postgres is reported as 4099 chars long, but maybe this is another history. Sergio
Sergio wrote: > > Byron, > > Postgres 6.3.2, Odbc driver 6.40.0004 > <snipped real problem, since I know nothing about it!> (although, I do know that the communications protocol changed 6.3->6.4. Might an upgrade help?) > > I wonder why a text saved by Notepad is 4183 bytes and this > same text within Postgres is reported as 4099 chars long, but > maybe this is another history. Hmm, this text wouldn't have 84 lines, would it? That'd be an average of ~49 characters per line, so it's reasonable. DOS/Win uses CR/LF line ending pairs, while the unix backend only stores LF (or is that CR? Doesn't matter, 2 bytes vs. one byte) Just think of it as the earliest example of Microsoft code bloat ;-) Ross -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
Sergio <ser@perio.unlp.edu.ar> el día Tue, 30 Mar 1999 12:40:10 -0300, escribió: > >Byron, > >Postgres 6.3.2, Odbc driver 6.40.0004 > > >I get this > >'Access violation at address xxxxxxx in module 'PSQLODBC.DLL'. >Read of address yyyyyyyy' > >calling SQLGetData( hstmt, FieldNo, SQL_BINARY, SQLPOINTER( @i), 0, @iv); > >note the 5th parameter -> 0 > >over a TEXT field with sizes of 4000 or more bytes. > >if I try it with small fields (3000 or so bytes) there is no problem. > >ok, I tracked it down and it seems to work until iv=4099, >when it must return 4100, boom ! I _think_ I found the problem: in convert.c in the function copy_and_convert_field, you declare char tempBuf[TEXT_FIELD_SIZE+5]; wich is fixed at _compile_ time, no ?, so the TEXT_FIELD_SIZE wich is an option in the Odbc driver cfg, is ignored. I'm rigth ? (because changing Max LongVarChar in the cfg doesn't seems to affect nothing) Sergio