X-Original-To: pgsql-odbc@postgresql.org Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 20627476321 for ; Fri, 21 Mar 2003 00:15:19 -0500 (EST) Received: (qmail 7491 invoked from network); 21 Mar 2003 05:15:24 -0000 Received: from unknown (HELO viscomail.tpf.co.jp) (100.0.0.108) by sd2.tpf-fw-c.co.jp with SMTP; 21 Mar 2003 05:15:24 -0000 Received: from tpf.co.jp ([126.0.1.65]) by viscomail.tpf.co.jp (8.8.8+Sun/8.8.8) with ESMTP id OAA06010; Fri, 21 Mar 2003 14:15:22 +0900 (JST) Message-ID: <3E7AA0A7.C6DB2B90@tpf.co.jp> Date: Fri, 21 Mar 2003 14:18:31 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.73 [ja] (Windows NT 5.0; U) X-Accept-Language: ja MIME-Version: 1.0 To: Han Cc: "pgsql-odbc@postgresql.org" Subject: Re: Problem with SQL_LONGVARBINAY References: Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Archive-Number: 200303/39 X-Sequence-Number: 2758 Sorry for the delay. Please try the snapshot dll at http://www.geocities.jp/inocchichichi/psqlodbc/. regards, Hiroshi Inoue http://www.geocities.jp/inocchichichi/psqlodbc/ Han wrote: > > Hi, > There's a problem when insert a SQL_LONGVARBINARY(lo) column in the following way: > Use SQLBindParameter(...SQL_DATA_AT_EXEC) > and SQLParamData, SQLPutData. > The last time SQLParamData revoke a crash! > This is the sample code: > for (...) > { > sdw = SQL_DATA_AT_EXEC; > rc = SQLBindParameter(hstmt, w, SQL_PARAM_INPUT, > SQL_C_TCHAR, rgFields[ind].wSQLType, > rgFields[ind].precision, rgFields[ind].scale, > (LPTSTR)(((UDWORD)ind)+BIND_PARM_OFFSET), 0, &sdw); > } > rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS); > if (SQL_NEED_DATA != rc) > return; > for(ind = 0; ind <= cTypes; ind++) > { > rc = SQLParamData(hstmt, &ptr); > if(rc != SQL_NEED_DATA) > break; > > pch = qtMakeData(...); > > if(*pch) { > rc = SQLPutData(hstmt, pch, SQL_NTS); > } else { > rc = SQLPutData(hstmt, (LPTSTR)IGNORED, SQL_NULL_DATA); > } > } > > please check, thanks and regards!