<div>Boa tarde,</div>
<div>Tenho uma duvida ao tentar usar SQL server no MAPSERVER.</div>
<div> </div>
<div>Consigo efectuar a connection mas no parametro DATA dá o seguinte erro:</div>
<div> </div>
<div>
<table cellspacing="0" cellpadding="0" width="509" border="0">
<tbody>
<tr>
<td><font color="#000099">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'.<br>
Standard ways of specifiying are : <br>(1) 'geometry_column from geometry_table' <br>(2) 'geometry_column from (<sub query>) as foo using unique <column name> using SRID=<srid#>' <br><br>
Make sure you utilize the 'using unique <column name>' and 'using with <index name>' clauses in. <br><br>For more help, please see <a href="http://www.mapdotnet.com">http://www.mapdotnet.com</a> <br>
<br>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), <a href="http://sys.columns.name">sys.columns.name</a>) AS ColumnName, <a href="http://sys.indexes.name">sys.indexes.name</a> 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 (<a href="http://sys.tables.name">sys.tables.name</a> = 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</font> </td>
</tr></tbody></table></div>
<div> </div>
<div>Como posso aceder a uma tabela em em SQL de forma a ficar visivel a geometria no map server?</div>
<div> </div>
<div>Criei a seguinte Layer:</div>
<div>LAYER<br> METADATA<br> "DESCRIPTION" "TESTE DE LIGAÇÃO A BD"<br> END<br> CONNECTIONTYPE PLUGIN<br> PLUGIN "C:/ms4w/Apache/specialplugins/msplugin_mssql2008.dll"<br> CONNECTION "server=***;uid=***;pwd=***;database=SIG; Integrated Security=false"<br>
DATA "geometry from lic_2004"<br> NAME "Lic_2004"<br> STATUS ON<br> TRANSPARENCY 100<br> TYPE POLYGON<br> UNITS METERS<br> CLASS<br> STYLE<br> COLOR 210 200 190<br> OUTLINECOLOR 195 212 157<br>
END<br> END</div>
<div>END</div>
<div><br clear="all"></div>
<div></div>
<div>Dá o erro acima indicado.</div>
<div> </div>
<div>Obrigado</div>
<div>Lisete Vieira</div>