From: Nick Gorham <nick@lurcherlink.org>
To: Igor Korot <ikorot01@gmail.com>
To: PostgreSQL ODBC list <pgsql-odbc@postgresql.org>
Subject: Re: Fwd: Problem retrieving data
Date: Sun, 15 Nov 2026 13:19:51 +0000
Message-ID: <f91b72e5-8d25-4593-9aa6-034cbc29cdd6@lurcherlink.org> (raw)
In-Reply-To: <CA+FnnTw=KC48Fnr5aTqY1RFXnm0_7W9Pykkb3faGk+TF4MdfwQ@mail.gmail.com>
References: <CA+FnnTwpXj62t9DHzruBGBv2DzowRmm14DiuUUppfpEe+ZDt4A@mail.gmail.com>
<CA+FnnTw=KC48Fnr5aTqY1RFXnm0_7W9Pykkb3faGk+TF4MdfwQ@mail.gmail.com>
On 15/11/2026 08:12, Igor Korot wrote:
> ret = SQLBindCol( m_hstmt, 1, SQL_C_WCHAR, &styleName, 33,
> &cbStyleName );
That should be
ret = SQLBindCol( m_hstmt, 1, SQL_C_WCHAR, &styleName, sizeof(styleName) ,&cbStyleName );
The buffer length argument is always the size of the buffer in bytes, not in characters (in this case).
In this case sizeof(styleName) will be 66, not 33;
--
Nick Gorham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: nick@lurcherlink.org, ikorot01@gmail.com, pgsql-odbc@postgresql.org
Subject: Re: Fwd: Problem retrieving data
In-Reply-To: <f91b72e5-8d25-4593-9aa6-034cbc29cdd6@lurcherlink.org>
References: <CA+FnnTwpXj62t9DHzruBGBv2DzowRmm14DiuUUppfpEe+ZDt4A@mail.gmail.com> <CA+FnnTw=KC48Fnr5aTqY1RFXnm0_7W9Pykkb3faGk+TF4MdfwQ@mail.gmail.com> <f91b72e5-8d25-4593-9aa6-034cbc29cdd6@lurcherlink.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox