large objects, visual basic, ADO

From: Tulassay Zsolt <zsolt(at)tek(dot)bke(dot)hu>
To: pgsql-odbc(at)postgresql(dot)org
Subject: large objects, visual basic, ADO
Date: 2001-05-24 21:59:55
Message-ID: Pine.LNX.4.21.0105242329070.7301-100000@tek.bke.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc


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

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2001-05-25 08:28:55 ODBC changes
Previous Message radius 2001-05-24 19:59:02 firewall issues..