pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Han <zhouhanok@vip.sina.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Problem about Bytea and SQL_C_CHAR
Date: Thu, 28 Nov 2002 13:4:8 +0800
Message-ID: <20021128050339.42D3F4759AF@postgresql.org> (raw)

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@vip.sina.com
          2002-11-28






view thread (8+ messages)  latest in thread

Message-ID: <20021128050339.42D3F4759AF@postgresql.org>
Permalink:  ../20021128050339.42D3F4759AF@postgresql.org/
Also on:    postgresql.org/message-id/20021128050339.42D3F4759AF@postgresql.org

 · 

reply

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-odbc@postgresql.org
  Cc: zhouhanok@vip.sina.com
  Subject: Re: Problem about Bytea and SQL_C_CHAR
  In-Reply-To: <20021128050339.42D3F4759AF@postgresql.org>
  References: <20021128050339.42D3F4759AF@postgresql.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