pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ADO Connection with Postgres
6+ messages / 3 participants
[nested] [flat]

* ADO Connection with Postgres
@ 2004-07-16 23:54 Michael Aldor <MAldor@greenridge.ca>
  2004-07-17 15:27 ` Re: ADO Connection with Postgres Jeff Eckermann <jeff_eckermann@yahoo.com>
  2004-07-17 15:39 ` Re: ADO Connection with Postgres Raymond O'Donnell <rod@iol.ie>
  0 siblings, 2 replies; 6+ messages in thread

From: Michael Aldor @ 2004-07-16 23:54 UTC (permalink / raw)
  To: pgsql-odbc

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=<servername>;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("<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.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.)




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: ADO Connection with Postgres
  2004-07-16 23:54 ADO Connection with Postgres Michael Aldor <MAldor@greenridge.ca>
@ 2004-07-17 15:27 ` Jeff Eckermann <jeff_eckermann@yahoo.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Jeff Eckermann @ 2004-07-17 15:27 UTC (permalink / raw)
  To: Michael Aldor <MAldor@greenridge.ca>; pgsql-odbc

--- Michael Aldor <MAldor@greenridge.ca> wrote:
> 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=<servername>;Port=5432;Database=imagedb;UID=imageUser"
> 
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.Open "image_table", connectionString,
> adOpenKeyset, adLockOptimistic, adCmdTable

Try doing "select * from image_table", instead of just
attempting to open the table.

> 'After I run rs.open 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.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
> 



		
__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: ADO Connection with Postgres
  2004-07-16 23:54 ADO Connection with Postgres Michael Aldor <MAldor@greenridge.ca>
@ 2004-07-17 15:39 ` Raymond O'Donnell <rod@iol.ie>
  1 sibling, 0 replies; 6+ messages in thread

From: Raymond O'Donnell @ 2004-07-17 15:39 UTC (permalink / raw)
  To: pgsql-odbc

On 16 Jul 2004 at 18:54, Michael Aldor wrote:

> ConnectionString =
> "Driver={PostgreSQL};Server=<servername>;Port=5432;Database=imagedb;UI
> D=im ageUser" 

Should there be a password?

--Ray.


-------------------------------------------------------
Raymond O'Donnell          http://www.iol.ie/~rod/organ
rod@iol.ie                    The Irish Pipe Organ Page
-------------------------------------------------------




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: ADO Connection with Postgres
@ 2004-07-19 15:11 Michael Aldor <MAldor@greenridge.ca>
  2004-07-19 23:23 ` Re: ADO Connection with Postgres Jeff Eckermann <jeff_eckermann@yahoo.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Michael Aldor @ 2004-07-19 15:11 UTC (permalink / raw)
  To: 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 rs.open 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.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=<servername>;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("<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.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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: ADO Connection with Postgres
  2004-07-19 15:11 Re: ADO Connection with Postgres Michael Aldor <MAldor@greenridge.ca>
@ 2004-07-19 23:23 ` Jeff Eckermann <jeff_eckermann@yahoo.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Jeff Eckermann @ 2004-07-19 23:23 UTC (permalink / raw)
  To: Michael Aldor <MAldor@greenridge.ca>; pgsql-odbc

--- Michael Aldor <MAldor@greenridge.ca> 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("<br><br>" & 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=<servername>;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("<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.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/




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: ADO Connection with Postgres
@ 2004-07-19 16:12 Michael Aldor <MAldor@greenridge.ca>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Aldor @ 2004-07-19 16:12 UTC (permalink / raw)
  To: pgsql-odbc


I noticed I spelled appendchunk wrong, I am now getting the following error:

Operation is not allowed in this context. errorNum= 3219

This error seems to be due to incompatibility with appendchunk and bytea
as the error gets returned with an incompatible field according to Microsoft
http://support.microsoft.com/default.aspx?scid=kb;en-us;113949

Is there any other Postgres datatype that can store blobs? Is there another driver I should use that allows compatability between bytea and appendchunk.

Thanks.

Michael

-----Original Message-----
From: Michael Aldor 
Sent: Monday, July 19, 2004 10:11 AM
To: pgsql-odbc@postgresql.org
Subject: Re: [ODBC] ADO Connection with Postgres



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 rs.open 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.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=<servername>;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("<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.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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2004-07-19 23:23 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-16 23:54 ADO Connection with Postgres Michael Aldor <MAldor@greenridge.ca>
2004-07-17 15:27 ` Jeff Eckermann <jeff_eckermann@yahoo.com>
2004-07-17 15:39 ` Raymond O'Donnell <rod@iol.ie>
2004-07-19 15:11 Re: ADO Connection with Postgres Michael Aldor <MAldor@greenridge.ca>
2004-07-19 23:23 ` Jeff Eckermann <jeff_eckermann@yahoo.com>
2004-07-19 16:12 Re: ADO Connection with Postgres Michael Aldor <MAldor@greenridge.ca>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox