X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7D2F63A3C44 for ; Tue, 23 Nov 2004 08:20:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54083-03 for ; Tue, 23 Nov 2004 08:19:49 +0000 (GMT) Received: from mail.nsasia.co.th (mail.nsasia.co.th [203.146.6.34]) by svr1.postgresql.org (Postfix) with ESMTP id 19BAC3A3B13 for ; Tue, 23 Nov 2004 08:19:49 +0000 (GMT) Received: from [192.168.200.40] (helo=jupiter.nsasia.co.th) by astaro.nsasia.co.th with esmtp (Exim 4.43) id 1CWVts-0001NT-EM for pgsql-sql@postgresql.org; Tue, 23 Nov 2004 15:19:48 +0700 Received: from Thailand-MTA by jupiter.nsasia.co.th with Novell_GroupWise; Tue, 23 Nov 2004 15:19:42 +0700 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.2 Date: Tue, 23 Nov 2004 15:19:15 +0700 From: "Premsun Choltanwanich" To: , , Subject: Re: Image Insert Postgresql DB Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/245 X-Sequence-Number: 19564 I use VB as develop tool and ADO for connect. My code is show below and for vPicMember is stand ADOStream in Binary. rs.Open "SELECT * FROM t_mbrpic WHERE mbrsysid = " & vSysId, conn, adOpenStatic, adLockOptimistic If rs.EOF Then rs.AddNew rs!MbrSysId = vSysId rs!MbrPic = vPicMember.Read rs.Update rs.Close In this case, Is I must still escape the octets with \\ that is two backslashes? Could anybody has some suggestion? >>> Kenneth Gonsalves 23/11/2004 2:40:27 pm >>> On Tuesday 23 November 2004 12:48 pm, Premsun Choltanwanich wrote: > I face this same problem when I try to insert image by lo_import to > database with my client files. I already change the way to bytea data > type but it's not work. The error return like type mismatch when I try > to insert it from Binary variable. > > Why I cannot insert it? If anybody found some solution please reply on > this topic for me too. you must escape the octets with \\ that is two backslashes and not one backslash. for example if your binary data is like this: \x05\x00\x02 you must make it like so: \\x05\\x00\\x02 please see chapter 8.4 of the postgresql manual. kg ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org