X-Original-To: pgsql-odbc@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C1528476002 for ; Wed, 5 Feb 2003 10:46:16 -0500 (EST) Received: from ny-bas06.csfb.com (ny-bas06.csfb.com [198.240.130.90]) by postgresql.org (Postfix) with ESMTP id 426404761EA for ; Wed, 5 Feb 2003 10:04:58 -0500 (EST) X-Server-Uuid: a46faee8-2a4f-11d3-9c63-00508b4fa69c X-Server-Uuid: 8e2ee05e-e4bb-11d3-929c-00508b6fed5f Subject: psqlodbc : SOS To: pgsql-odbc@postgresql.org Message-ID: From: mjoseph@inautix.com Date: Wed, 5 Feb 2003 20:29:35 +0530 X-MIMETrack: Serialize by Router on INACENTPLN01/iNautix(Release 5.0.8 |June 18, 2001) at 02/05/2003 08:19:25 PM MIME-Version: 1.0 X-WSS-ID: 125FF796851091-01-01 X-WSS-ID: 125FF7971018906-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/33 X-Sequence-Number: 2651 Hi, I am using the psqlodbc ODBC driver. I have a few problems. I was wondering if you could help. I am using Visual C++ to develop my app. I need to access a byte array (bytea) field. 1. I use the Windows ODBC api to insert the byte array ( a photograph). I do multiple SQLPutData() calls. This application works fine with Access. But with PostgreSQL, it fails. A number gets inserted instead (5 bytes). 2. I tried using MFC's ODBC support. In the CRecordSet's DoFieldExchange(CFieldExchange* pFX) method, I setup the binding as below. RFX_Binary(pFX, _T("[data]"), m_data, 100*1024); 100K I assume is the upper limit of the field. THis works on Access but not for PostgreSQL. The default limit of 255 is not overridden. If any of these are known issues, could you let me know. If you have any ideas as to how I can set this right, please get back to me. 3. The psqlodbc faq when discussing Large Objects suggests creating a new type like this. create type lo ( internallength=4, externallength=10, input=int4in, output=int4out, default='', passedbyvalue ); How should I define the input and output functions. Would you be able to pass on some sample code? Regards, Manoj