Skip site navigation (1) Skip section navigation (2)

Re: ADO Connection with Postgres

From: "Michael Aldor" <MAldor(at)greenridge(dot)ca>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: ADO Connection with Postgres
Date: 2004-07-19 15:11:20
Message-ID: (view raw or whole thread)
Lists: pgsql-odbc
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?

rs.Open "image_table",ConnectionString, 2, 2, 2
'After I run the following error check gives me the following error:
if err then
  response.write("<br><br>" & err.Description & " errorNum= " & Err.number)
end if
'Object required errorNum= 424
  rs("image_name") = nameRef
  rs("image").appenchunk fileData
  rs("content_type") = contentType
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(at)postgresql(dot)org
Subject: [ODBC] ADO Connection with Postgres


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=<servername>;Port=5432;Database=imagedb;UID=imageUser"

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "image_table", connectionString, adOpenKeyset, adLockOptimistic, adCmdTable
'After I run the following error eheck gives me the following error:
if err then
  response.write("<br><br>" & 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("img_name") = nameRef 'name of the file
 rs("img").AppendChunk fileData 'file data being some binary data
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

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


pgsql-odbc by date

Next:From: Dave PageDate: 2004-07-19 15:47:30
Subject: psqlODBC LGPL Licence
Previous:From: Jeff EckermannDate: 2004-07-19 13:52:14
Subject: Re: error with access 2003 - column "ctid" does not exist

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group