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

large objects, visual basic, ADO

From: Tulassay Zsolt <zsolt(at)tek(dot)bke(dot)hu>
To: pgsql-odbc(at)postgresql(dot)org, pgsql-interfaces(at)postgresql(dot)org
Subject: large objects, visual basic, ADO
Date: 2001-05-27 14:56:03
Message-ID: Pine.LNX.4.21.0105271654320.11591-100000@tek.bke.hu (view raw or flat)
Thread:
Lists: pgsql-interfacespgsql-odbc
(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



Responses

pgsql-odbc by date

Next:From: Ken J. WrightDate: 2001-05-28 12:08:57
Subject: Re: Kylix inerface
Previous:From: radiusDate: 2001-05-25 16:31:08
Subject: Wierd ODBC access issue

pgsql-interfaces by date

Next:From: radiusDate: 2001-05-27 16:17:20
Subject: access + odbc = readonly!?!?!?
Previous:From: SAKAIDADate: 2001-05-26 13:08:23
Subject: String array type in ecpg.

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