Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0818B475A3F for ; Thu, 28 Nov 2002 00:03:52 -0500 (EST) Received: from vip.sina.com (unknown [202.108.35.183]) by postgresql.org (Postfix) with SMTP id 42D3F4759AF for ; Thu, 28 Nov 2002 00:03:39 -0500 (EST) Received: (qmail 46873 invoked from network); 28 Nov 2002 05:03:38 -0000 Received: from unknown (HELO zh) (218.108.232.5) by 202.108.35.183 with SMTP; 28 Nov 2002 05:03:38 -0000 From: "Han" To: pgsql-odbc@postgresql.org Subject: Re: Problem about Bytea and SQL_C_CHAR X-mailer: Foxmail 4.2 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: quoted-printable Date: Thu, 28 Nov 2002 13:4:8 +0800 Message-Id: <20021128050339.42D3F4759AF@postgresql.org> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/192 X-Sequence-Number: 2369 Hiroshi Inoue, Hi! I checked the crashing code and abstracted this: =09 int data=3D1; int cb; rc =3D SQLPrepare(hstmt, "insert into test1(a) values(?)", SQL_NTS); rc =3D SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_TCHAR, SQL_INTEGER, 4, 0, &data, MAX_STRING_SIZE, &cb);=09 rc =3D SQLExecute(hstmt); rc =3D SQLFreeStmt(hstmt, SQL_RESET_PARAMS); rc =3D SQLExecDirect(hstmt, "select * from test1", SQL_NTS); Table test1 has just one int column a. The SQLExecDirect crashed! Replace it with SQLBindParameter after that SQL= FreeStmt 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 r= ight. > >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, =09=09=09=09 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1Han =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1zhouhanok@vip.sina.com =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A12002-11-28