[Portugal] erro na conecção ao sql server

Lisete Vieira lisetelvieira at gmail.com
Tue Aug 18 11:19:59 EDT 2009


Boa tarde,
Tenho uma duvida ao tentar usar SQL server no MAPSERVER.

Consigo efectuar a connection mas no parametro DATA dá o seguinte erro:

  Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named
'Lic_2004'. in C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php on line 40 Warning:
[MapServer Error]: msMSSQL2008LayerOpen(): Could not parse the layer data in
C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php on line 40 Warning: [MapServer
Error]: msMSSQL2008LayerParseData(): No primary key defined for table, or
primary key contains more that one column Error with MSSQL2008 data
variable. You specified 'lic_2004'.
Standard ways of specifiying are :
(1) 'geometry_column from geometry_table'
(2) 'geometry_column from (<sub query>) as foo using unique <column name>
using SRID=<srid#>'

Make sure you utilize the 'using unique <column name>' and 'using with
<index name>' clauses in.

For more help, please see http://www.mapdotnet.com

mapmssql2008.c - version of 2007/7/1. in
C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php on line 40 Warning: [MapServer
Error]: msMSSQL2008LayerRetrievePK(): Error executing MSSQL2008 statement
(msMSSQL2008LayerRetrievePK():SELECT convert(varchar(50), sys.columns.name)
AS ColumnName, sys.indexes.name FROM sys.columns INNER JOIN sys.indexes
INNER JOIN sys.tables ON sys.indexes.object_id = sys.tables.object_id INNER
JOIN sys.index_columns ON sys.indexes.object_id =
sys.index_columns.object_id AND sys.indexes.index_id =
sys.index_columns.index_id ON sys.columns.object_id =
sys.index_columns.object_id AND sys.columns.column_id =
sys.index_columns.column_id WHERE (sys.indexes.is_primary_key = 1) AND (
sys.tables.name = N'lic_2004') in C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php
on line 40 Fatal error: Call to a member function saveWebImage() on a
non-object in C:\ms4w\apps\WebGis_PHP\htdocs\codigo.php on line 42

Como posso aceder a uma tabela em em SQL de forma a ficar visivel a
geometria no map server?

Criei a seguinte Layer:
LAYER
 METADATA
        "DESCRIPTION" "TESTE DE LIGAÇÃO A BD"
    END
    CONNECTIONTYPE PLUGIN
 PLUGIN "C:/ms4w/Apache/specialplugins/msplugin_mssql2008.dll"
 CONNECTION "server=***;uid=***;pwd=***;database=SIG; Integrated
Security=false"
 DATA "geometry from lic_2004"
 NAME "Lic_2004"
    STATUS ON
    TRANSPARENCY 100
    TYPE POLYGON
    UNITS METERS
    CLASS
      STYLE
        COLOR 210 200 190
        OUTLINECOLOR 195 212 157
      END
    END
END

 Dá o erro acima indicado.

Obrigado
Lisete Vieira
-------------- próxima parte ----------
Um anexo em HTML foi limpo...
URL: http://lists.osgeo.org/pipermail/portugal/attachments/20090818/98e03ea6/attachment.html


More information about the Portugal mailing list