Re: Problem about Bytea and SQL_C_CHAR

From: "Han" <zhouhanok(at)vip(dot)sina(dot)com>
To: pgsql-odbc(at)postgresql(dot)org <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Problem about Bytea and SQL_C_CHAR
Date: 2002-11-28 05:04:08
Message-ID: 20021128050339.42D3F4759AF@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hiroshi Inoue,

Hi! I checked the crashing code and abstracted this:

int data=1;
int cb;
rc = SQLPrepare(hstmt, "insert into test1(a) values(?)", SQL_NTS);
rc = SQLBindParameter(hstmt, 1,
SQL_PARAM_INPUT,
SQL_C_TCHAR, SQL_INTEGER,
4, 0,
&data, MAX_STRING_SIZE,
&cb);
rc = SQLExecute(hstmt);
rc = SQLFreeStmt(hstmt, SQL_RESET_PARAMS);
rc = SQLExecDirect(hstmt, "select * from test1", SQL_NTS);

Table test1 has just one int column a.
The SQLExecDirect crashed! Replace it with SQLBindParameter after that SQLFreeStmt will lead to crash! Please try it.

>Han wrote:
>> The previous version I've been using was psqlodbc30.dll(driver name is "PostgreSQL + (Beta)", and I never changed it. I just replaced the new 7.02.0006 dll, and the version number in the ODBC Data Source Administrator is right.
>
>A simple test case passed here.
>Hmm could you send me the sample code if it's simple ?
>
>regards,
>Hiroshi Inoue
> http://w2422.nsk.ne.jp/~inoue/

regards,

        Han
        zhouhanok(at)vip(dot)sina(dot)com
          2002-11-28

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2002-11-28 06:36:17 Re: Problem about Bytea and SQL_C_CHAR
Previous Message Han 2002-11-28 03:28:45 Re: Problem about Bytea and SQL_C_CHAR