pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedlarge objects, visual basic, ADO
2+ messages / 2 participants
[nested] [flat]
* large objects, visual basic, ADO
@ 2001-05-27 14:56 Tulassay Zsolt <zsolt@tek.bke.hu>
0 siblings, 1 reply; 2+ messages in thread
From: Tulassay Zsolt @ 2001-05-27 14:56 UTC (permalink / raw)
To: pgsql-odbc@postgresql.org; pgsql-interfaces
(I've posted this once before, but it didn't make it to the list
I hope this time it will work)
hi,
I tried the combination of the above three (for now only for reading)
but did not succeed. I searched the mailing list archives, but did not
find any appropriate solution, so if anybody out there ever saw this
working please drop me a line on how to do it.
I use PostgreSQL 7.1-RC4 (I know, I know), some recent 7.x ODBC driver,
and VB6 on the client side with ADO 2.0
I have a table called lo1 which looks like this:
zsolt=# \d lo1
Table "lo1"
Attribute | Type | Modifier
-----------+-----------------------+----------
name | character varying(32) |
image | oid |
I tried to fetch the data from pg_largeobject and write it to a file on
the client using the following VB code:
rs.Open "select * from pg_largeobject where loid=(select image _
from lo1 where name='tilos') ORDER BY pageno", env1.conn1
Open "C:\zsolt\t1.bmp" For Binary Access Write As #1
rs.MoveFirst
Do While Not rs.EOF
> varChunk = rs.Fields(2)
Put #1, , varChunk
rs.MoveNext
Loop
Close #1
rs.Close
The problem seems to be in the line marked with ">".
As it seems for me, the size of the data chunks in pg_largeobject is 2048
bytes. But in the code above only the first 254 bytes are "visible"
through the ADO interface. The first 254 bytes do get transferred
correctly, but the rest is lost, so the file I get in the end is about 1/8
the size of the original (actually a bit more, but I didn't check the
contents byte by byte, just the beginning of each file)
Any help/solution would be greatly appreciated (I don't care if it's RDO
or whatever)
Thanks,
Zsolt Tulassay
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [ODBC] large objects, visual basic, ADO
@ 2001-05-29 05:39 Hiroshi Inoue <Inoue@tpf.co.jp>
parent: Tulassay Zsolt <zsolt@tek.bke.hu>
0 siblings, 0 replies; 2+ messages in thread
From: Hiroshi Inoue @ 2001-05-29 05:39 UTC (permalink / raw)
To: Tulassay Zsolt <zsolt@tek.bke.hu>; +Cc: pgsql-odbc@postgresql.org; pgsql-interfaces
Tulassay Zsolt wrote:
>
> (I've posted this once before, but it didn't make it to the list
> I hope this time it will work)
>
> hi,
> I tried the combination of the above three (for now only for reading)
> but did not succeed. I searched the mailing list archives, but did not
> find any appropriate solution, so if anybody out there ever saw this
> working please drop me a line on how to do it.
>
You need the type 'lo' to use large objects from ODBC.
See contrib/lo or go to a mirror ftp site and see
odbc/faq.html(Can I use large objects or OLE ?).
regards,
Hiroshi Inoue
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-05-29 05:39 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-27 14:56 large objects, visual basic, ADO Tulassay Zsolt <zsolt@tek.bke.hu>
2001-05-29 05:39 ` Hiroshi Inoue <Inoue@tpf.co.jp>
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