[MapServer-users] das "PLUGIN -msplugin_mssql2008.dll" Problem bei Mapserver 8

Seth G sethg at geographika.co.uk
Fri Sep 20 04:42:22 PDT 2024


Hi Valeri,

The docs at https://mapserver.org/input/vector/mssql.html#option-2-connect-through-mapserver-plugin are out of date since version 8 of MapServer.
For all layers using a PLUGIN you have to add the plugin to your MapServer CONFIG file: https://mapserver.org/mapfile/config.html#config

For example:

  PLUGINS
    "mssql" "d:\www\cgi-bin\ms5\msplugin_mssql2008.dll"
  END

Then you use the key to the plugin in your Mapfile. This avoids MapServer loading possibly untrusted DLLs:

  LAYER
   NAME "..."
   CONNECTIONTYPE PLUGIN
   PLUGIN "mssql" # this should be the key used in the CONFIG file - 
   CONNECTION "server=ServName;uid=_user;pwd=pass;database=DB-Name;Integrated Security=false"
   DATA "GEOMETRY_LL84 from GEOM_VG_BULA using unique ID using SRID=4326"
   TYPE POLYGON
   STATUS OFF

When using the Mapfile through MapScript you will need to pass the path to your CONFIG file. See https://github.com/MapServer/MapServer/pull/6646 for details. 

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. 

Seth

--
web:https://geographika.net & https://mapserverstudio.net
mastodon: @geographika at mastodon.social

On Fri, Sep 20, 2024, at 12:08 PM, Liandres, Valeri via MapServer-users wrote:
> Hello,
> 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.
> One component of the project is DB query MSSQL - Server using MAP file and PLUGIN routine.
> 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.
> The call is in the PHP file as:
> $oMap = new mapObj(MAPFILE);$oMap->setSize(1990, 1160);....    $oImage = $oMap->draw();
> -------
> MAP
> ...
>   LAYER
>    NAME "..."
>    CONNECTIONTYPE PLUGIN
>    PLUGIN "d:\www\cgi-bin\ms5\msplugin_mssql2008.dll"
>    CONNECTION "server=ServName;uid=_user;pwd=pass;database=DB-Name;Integrated Security=false"
>    *DATA "GEOMETRY_LL84 from GEOM_VG_BULA using unique ID using SRID=4326"       <<<<<  *here table *GEOM_VG_BULA* , column *GEOMETRY_LL84*
>    TYPE POLYGON
>    STATUS OFF
> ...
> END
> -------
> The error message:
> Fatal error: Uncaught Exception: msDrawMap(): Image handling error. Failed to draw layer named 'Bundeslaender'.;msMSSQL2008LayerOpen():
>  *Query error*. Error with MSSQL2008 data variable. You specified 'Error parsing MSSQL2008 *data variable: nothing specified in DATA statement*.
> <br><br> More Help:<br><br> '.<br> Standard ways of specifying 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 http://www.mapdotnet.com <br><br>mapmssql2008.c - version of 2007/7/1. in D:\www\cgi-bin\ms5\quickmap_geometry.php:13
>  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
>  
> Is this a problem only with version 8.0?
> Unfortunately, we cannot use "Connection type OGR" in our project structure.
>  
> Can anyone help us?
> Valeri
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20240920/12b9ff5b/attachment.htm>


More information about the MapServer-users mailing list