X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B9534D1B1F8 for ; Mon, 19 Jul 2004 20:24:54 -0300 (ADT) 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 53098-03 for ; Mon, 19 Jul 2004 23:24:48 +0000 (GMT) Received: from web20809.mail.yahoo.com (web20809.mail.yahoo.com [216.136.226.198]) by svr1.postgresql.org (Postfix) with SMTP id E4001D1B16A for ; Mon, 19 Jul 2004 20:23:48 -0300 (ADT) Message-ID: <20040719232351.3124.qmail@web20809.mail.yahoo.com> Received: from [24.248.12.72] by web20809.mail.yahoo.com via HTTP; Mon, 19 Jul 2004 16:23:51 PDT Date: Mon, 19 Jul 2004 16:23:51 -0700 (PDT) From: Jeff Eckermann Subject: Re: ADO Connection with Postgres To: Michael Aldor , pgsql-odbc@postgresql.org In-Reply-To: <84D4D76946AC2F43AA9BDCD860DC66754FB27A@voyager.greenridge-int.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200407/103 X-Sequence-Number: 4236 --- Michael Aldor wrote: > > I have the ADO recordset open connection working, > however the append chunk is not inserting anything > into the bytea field (image). I am getrting data > into image_name and content_type. Any ideas on how > to insert binary data to postgres? I haven't messed with bytea. But you might get somewhere with this: http://gborg.postgresql.org/project/psqlodbc/genpage.php?howto-vblo > > rs.Open "image_table",ConnectionString, 2, 2, 2 > 'After I run rs.open the following error check gives > me the following error: > if err then > response.write("

" & err.Description & " > errorNum= " & Err.number) > end if > 'Object required errorNum= 424 > rs.AddNew > rs("image_name") = nameRef > rs("image").appenchunk fileData > rs("content_type") = contentType > rs.Update > rs.Close > Set rs = Nothing > ' after code is run the data in nameRef and > contentType are store in the database, however > fileData is not. > > > -----Original Message----- > From: Michael Aldor > Sent: Friday, July 16, 2004 6:55 PM > To: pgsql-odbc@postgresql.org > Subject: [ODBC] ADO Connection with Postgres > > > Hello, > > I am trying to connect to a postgres database in ASP > (vbscript) and insert a blob into a bytea field. > However I cannot create an open connection via the > following method. > > Any help/suggestions would be appreciated. > > ConnectionString = > "Driver={PostgreSQL};Server=;Port=5432;Database=imagedb;UID=imageUser" > > Set rs = Server.CreateObject("ADODB.Recordset") > rs.Open "image_table", connectionString, > adOpenKeyset, adLockOptimistic, adCmdTable > 'After I run rs.open the following error eheck gives > me the following error: > if err then > response.write("

" & err.Description & " > errorNum= " & Err.number) > end if > 'Arguments are of the wrong type, are out of > acceptable range, or are > 'in conflict with one another. errorNum= 3001 > 'not sure what to change there > rs.begintrans > rs.AddNew > rs("img_name") = nameRef 'name of the file > rs("img").AppendChunk fileData 'file data being > some binary data > rs.Update > rs.committrans > rs.Close > Set rs = Nothing > > ------------------------------------------------------------------------------------------------------------------- > This communication, including its attachments, if > any, is intended solely > for the recipient; it is confidential and may > contain personal or private > information, or proprietary and/or privileged > material. As such, any > unauthorized use, retention, copying, disclosure or > other distribution of > this communication, or the taking of any action in > reliance on its contents > is strictly prohibited. If you have received this > communication in error, > please notify us immediately and delete this > communication (and any > attachments.) > > > ---------------------------(end of > broadcast)--------------------------- > TIP 8: explain analyze is your friend > > ---------------------------(end of > broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose > an index scan if your > joining column's datatypes do not match > __________________________________ Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign! http://advision.webevents.yahoo.com/yahoo/votelifeengine/