[postgis-users] Getting geometry into ADO

Val Macduff val.macduff at intragis.com.au
Tue May 9 23:51:00 PDT 2006


I am building a GIS browser interface to PostGIS data using VB6 to read the
PostGIS table. I need to get the complete geometry field into a VB6 Variant
variable to pass to the TatukGIS DK to create a shape.  My select statement
is

    sSelectString = "SELECT SRID(" & msShapeItem & ") as ShapeSRID," & _
                          "AsBINARY(" & msShapeItem & ",'XDR') as SHAPEWKB"
& _
                          " FROM " & msTableName & _
                          " WHERE " & msShapeItem & " IS NOT NULL"

When I use this on a point dataset or a small line dataset everything works
fine but if I try to access polygon data with very large numbers of
coordinates I cannot retrieve a value at all. The statement

vntCoords = rs.Fields("SHAPEWKB").Value

causes an immediate untrappable error.  If I look at the locals before this
happens, the value of SHAPEWKB is given as

<Application-defined or object-defined error>

Trying to fetch the data AsText or raw also results in the same "value"
being shown.

Does anyone know how I can do this?

Thanks, Val






More information about the postgis-users mailing list