Re: Using ODBC and VBA to pull data from a large object - Mailing list pgsql-general

From Adam C Falkenberg
Subject Re: Using ODBC and VBA to pull data from a large object
Date
Msg-id OFED72F4B0.F550D7A8-ON85257BEB.004433E0-85257BEB.00448EDF@notes.uss.com
Whole thread Raw
In response to Re: Using ODBC and VBA to pull data from a large object  (Vincent Veyron <vv.lists@wanadoo.fr>)
List pgsql-general
I'm using Excel.  I needed to set the MAXVARCHARSIZE parameter in the connection string to take care of my issue (MAXVARCHARSIZE=2048 for me).  That allowed the defined size of the field to equal the actual size.  Thanks everyone for your help!

Adam




From:        Vincent Veyron <vv.lists@wanadoo.fr>
To:        Adam C Falkenberg <ACFalkenberg@uss.com>,
Cc:        pgsql-general@postgresql.org
Date:        09/19/2013 04:59 AM
Subject:        Re: [GENERAL] Using ODBC and VBA to pull data from a large object
Sent by:        pgsql-general-owner@postgresql.org




Le mardi 17 septembre 2013 à 12:25 -0400, Adam C Falkenberg a écrit :
> Sorry about that.  Here's the driver information and some code.


> Driver Name: PostgreSQL ANSI
> Version: 9.02.01.00
>
> constr = "Driver={PostgreSQL ANSI}; Server=servername; Port=5432;
> Database=databasename; Uid=username; Pwd=password;"
> With conn
>     .ConnectionString = (constr)
>     .Open
> End With
>
> SQL = "SELECT data FROM pg_largeobject WHERE loid = " & id & " ORDER
> BY pageno"
> rs.Open SQL, conn
>
> stream.Type = adTypeBinary
> stream.Open
>        
> ' Loop through the recordset and write the binary data to the stream
> While Not rs.EOF
>     stream.Write rs.Fields("data").Value
>     rs.MoveNext
> Wend


You don't say where you use that recordset (Excel, Access?)

A google search will return several discussions about this problem; here
is an example :

http://social.msdn.microsoft.com/Forums/en-US/32b64a3f-3e7a-4e02-a7ef-824cacfea57a/256-char-limit-on-ado-recordset-field



--
Salutations, Vincent Veyron
http://gdlc.fr/logiciels
Applications de gestion des contentieux juridiques et des dossiers de sinistres assurance



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Patrick Dung
Date:
Subject: Re: the new checksum feature
Next
From: Agustin Larreinegabe
Date:
Subject: Re: Partitioning V schema