<!DOCTYPE html><html><head><title></title><style type="text/css">#qt p.qt-MsoNormal{margin-top:0cm;margin-right:0cm;margin-left:0cm;margin-bottom:0.0001pt;font-size:11pt;font-family:"Calibri", sans-serif;}
#qt a:link{color:rgb(5, 99, 193);text-decoration-color:currentcolor;text-decoration-line:underline;text-decoration-style:solid;text-decoration-thickness:auto;}
#qt a:visited{color:rgb(149, 79, 114);text-decoration-color:currentcolor;text-decoration-line:underline;text-decoration-style:solid;text-decoration-thickness:auto;}

p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi Valeri,<br></div><div><br></div><div>The docs at <a href="https://mapserver.org/input/vector/mssql.html#option-2-connect-through-mapserver-plugin">https://mapserver.org/input/vector/mssql.html#option-2-connect-through-mapserver-plugin</a> are out of date since version 8 of MapServer.<br></div><div>For all layers using a PLUGIN you have to add the plugin to your MapServer CONFIG file: <a href="https://mapserver.org/mapfile/config.html#config">https://mapserver.org/mapfile/config.html#config</a><br></div><div><br></div><div>For example:<br></div><div><br></div><div>  PLUGINS<br></div><div>    "mssql" "d:\www\cgi-bin\ms5\msplugin_mssql2008.dll"<br></div><div>  END<br></div><div><br></div><div>Then you use the key to the plugin in your Mapfile. This avoids MapServer loading possibly untrusted DLLs:<br></div><div><br></div><div>  LAYER<br></div><div>   NAME "..."<br></div><div>   CONNECTIONTYPE PLUGIN<br></div><div>   PLUGIN "mssql" # this should be the key used in the CONFIG file - <br></div><div>   CONNECTION "server=ServName;uid=_user;pwd=pass;database=DB-Name;Integrated Security=false"<br></div><div>   DATA "GEOMETRY_LL84 from GEOM_VG_BULA using unique ID using SRID=4326"<br></div><div>   TYPE POLYGON<br></div><div>   STATUS OFF<br></div><div><br></div><div>When using the Mapfile through MapScript you will need to pass the path to your CONFIG file. See <a href="https://github.com/MapServer/MapServer/pull/6646">https://github.com/MapServer/MapServer/pull/6646</a> for details. <br></div><div><br></div><div>This may resolve your current issue, unless you already use the DLL path a key, in which case it could be something else such as an extra double-quote in the CONNECTION string. <br></div><div><br></div><div>Seth<br></div><div><br></div><div id="sig62266145"><div class="signature">--<br></div><div class="signature">web:<a href="https://geographika.net">https://geographika.net</a> & <a href="https://mapserverstudio.net">https://mapserverstudio.net</a><br></div><div class="signature">mastodon: @<a href="mailto:geographika@mastodon.social">geographika@mastodon.social</a><br></div></div><div><br></div><div>On Fri, Sep 20, 2024, at 12:08 PM, Liandres, Valeri via MapServer-users wrote:<br></div><blockquote type="cite" id="qt" style=""><div class="qt-WordSection1"><p class="qt-MsoNormal"><span class="font" style="font-family:"Times New Roman", serif;"><span class="size" style="font-size:12pt;">Hello,</span></span><br></p><p class="qt-MsoNormal"><span class="font" style="font-family:"Times New Roman", serif;"><span class="size" style="font-size:12pt;">we are migrating our project with Mapserver 7 to Mapserver 8.0. Our project has been working stably under Mapserver 7 for a long time.</span></span><br></p><p class="qt-MsoNormal"><span class="font" style="font-family:"Times New Roman", serif;"><span class="size" style="font-size:12pt;">One component of the project is DB query MSSQL - Server using MAP file and PLUGIN routine.</span></span><br></p><p class="qt-MsoNormal"><span class="font" style="font-family:"Times New Roman", serif;"><span class="size" style="font-size:12pt;">Although we are using the latest version of "msplugin_mssql2008.dll", we always get an error message that the query is wrong. The table
 "GEOM_VG_BULA" and permissions are OK.</span></span><br></p><p class="qt-MsoNormal"><span class="font" style="font-family:"Times New Roman", serif;"><span class="size" style="font-size:12pt;">The call is in the PHP file as:</span></span><span class="font" style="font-family:"Times New Roman", serif;"><span class="size" style="font-size:12pt;"></span></span><br></p><p class="qt-MsoNormal">$oMap = new mapObj(MAPFILE);$oMap->setSize(1990, 1160);....    $oImage = $oMap->draw();<br></p><p class="qt-MsoNormal">-------<br></p><p class="qt-MsoNormal">MAP<br></p><p class="qt-MsoNormal">...<br></p><p class="qt-MsoNormal">  LAYER<br></p><p class="qt-MsoNormal">   NAME "..."<br></p><p class="qt-MsoNormal">   CONNECTIONTYPE PLUGIN<br></p><p class="qt-MsoNormal">   PLUGIN "d:\www\cgi-bin\ms5\msplugin_mssql2008.dll"<br></p><p class="qt-MsoNormal">   CONNECTION "server=ServName;uid=_user;pwd=pass;database=DB-Name;Integrated Security=false"<br></p><p class="qt-MsoNormal">   <b>DATA "GEOMETRY_LL84 from GEOM_VG_BULA using unique ID using SRID=4326"       <<<<<  </b><span class="qt-rynqvb"><span lang="EN">here table </span></span><b>GEOM_VG_BULA</b><span class="qt-rynqvb"><span lang="EN"> , column </span></span><b>GEOMETRY_LL84</b><br></p><p class="qt-MsoNormal">   TYPE POLYGON<br></p><p class="qt-MsoNormal">   STATUS OFF<br></p><p class="qt-MsoNormal">...<br></p><p class="qt-MsoNormal">END<br></p><p class="qt-MsoNormal">-------<br></p><p class="qt-MsoNormal"><span class="qt-rynqvb"><span lang="EN">The error message:</span></span><br></p><p class="qt-MsoNormal">Fatal error: Uncaught Exception: msDrawMap(): Image handling error. Failed to draw layer named 'Bundeslaender'.;msMSSQL2008LayerOpen():<br></p><p class="qt-MsoNormal"> <b>Query error</b>. Error with MSSQL2008 data variable. You specified 'Error parsing MSSQL2008 <b>data variable: nothing specified in DATA statement</b>.<br></p><p class="qt-MsoNormal"><br><br> More Help:<br><br> '.<br> Standard ways of specifying are : <br> (1) 'geometry_column from geometry_table' <br> (2) 'geometry_column from (&lt;sub query&gt;) as foo using unique &lt;column name&gt; using SRID=&lt;srid#&gt;' <br><br>
 Make sure you utilize the 'using unique &lt;column name&gt;' and 'using with &lt;index name&gt;' clauses in. <br><br>For more help, please see http://www.mapdotnet.com <br><br>mapmssql2008.c - version of 2007/7/1. in D:\www\cgi-bin\ms5\quickmap_geometry.php:13<br></p><p class="qt-MsoNormal"> Stack trace: #0 D:\www\cgi-bin\ms5\quickmap_geometry.php(13): mapObj->draw() #1 {main} thrown in D:\www\cgi-bin\ms5\quickmap_geometry.php on line<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal"><span class="qt-rynqvb"><span lang="EN">Is this a problem only with version 8.0?</span></span><br></p><p class="qt-MsoNormal"><span class="qt-rynqvb"><span lang="EN">Unfortunately, we cannot use "Connection type OGR" in our project structure.</span></span><br></p><p class="qt-MsoNormal"><span class="qt-rynqvb"><span lang="EN"> </span></span><br></p><p class="qt-MsoNormal"><span class="qt-rynqvb"><span lang="EN">Can anyone help us?</span></span><br></p><p class="qt-MsoNormal"><span class="qt-rynqvb"><span lang="EN">Valeri</span></span><br></p></div><div>_______________________________________________<br></div><div>MapServer-users mailing list<br></div><div><a href="mailto:MapServer-users@lists.osgeo.org">MapServer-users@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div><div><br></div></blockquote><div><br></div></body></html>