[mapserver-users] Mapserver MSSQL connect
Jeff McKenna
jmckenna at gatewaygeomatics.com
Wed May 9 11:53:15 PDT 2012
On 12-05-09 2:14 PM, j5c077 wrote:
> Hello list,
> I've been trying for a while to connect to my MSSQL spatial db with
> mapserver with no luck. If anyone could provide any insight I would be very
> grateful.
>
> The mapserver error i'm getting is "Unable to initialize connection to the
> server for MSSQL:server..., [unixODBC][Driver Manager]Data source name not
> found, and no default driver specified"
>
> MapServer is version 6.0.1 running on CentOS. my layer in the mapfile is
> currently set like this, though i've tried several variations based on the
> info i've found searching forums in hopes of getting it working:
>
> LAYER
> NAME "points"
> TYPE Point
> STATUS DEFAULT
> CONNECTIONTYPE OGR
> CONNECTION
> 'MSSQL:server=xxx.xxx.xxx.xxx,1433;database=database;uid=username;pwd=password'
> PROCESSING 'CLOSE_CONNECTION=DEFER'
> DATA "SP_GEOMETRY from points"
> CLASS
> NAME "point"
> STYLE
> SYMBOL "point"
> END
> END
> END
Connections to MSSQL in MapServer are through a compiled plugin, and you
can see examples of this CONNECTIONTYPE here:
http://www.mapserver.org/input/vector/mssql.html
(the MSSQL:server syntax you are using is how I would test the
connection through ogrinfo - more details at
http://www.gdal.org/ogr/drv_mssqlspatial.html)
-jeff
--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/
More information about the MapServer-users
mailing list