[mapserver-users] OGRinfo works, but a MapServer test mode=map DOES NOT
Jeff McKenna
jmckenna at gatewaygeomatics.com
Thu May 26 07:16:19 PDT 2011
Hello,
Viewing SQLServer2008 data in MapServer with MS4W 3.0.1 is done through
a plugin, and you should follow instructions in your local MS4W README
file for this (such as
http://www.maptools.org/ms4w/index.phtml?page=README_INSTALL.html#microsoft-sql-server-2008)
If you have any further questions, or comments, or problems with this,
please use the MS4W mailing list (subscribe at
http://lists.maptools.org/mailman/listinfo/ms4w-users)
Thank you.
-jeff
--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/
On 11-05-26 7:26 AM, Eduardo Kanegae wrote:
> Hi all,
>
> I´m running Windows Server 2008 R2 Enterprise SP1 64bits using MS4W
> 3.0.1 with MapServer CGI 5.6.6 grabed from MapTools.org
> My spatial data is on SQL Server 2008 + MsSqlSpatial 0.1.1 Lib and
> I´ve set an ODBC DSN connection using SQL Server Native Driver 10
> ( using Control Panel -> ODBC Admin -> System DSN and also
> C:\Windows\SysWOW64\odbcad32.exe tool )
>
> When I run ogrinfo using:
> $ ogrinfo -so "MSSQL:dsn=my_dsn;server=(local);database=my_database;tables=dbo.my_table;uid=my_user;pwd=my_passwd"
> my_table
>
> it works and dumps info like:
> ...
> INFO: Open of `MSSQL:dsn=nucoffee;server=(local);database=nucoffee;tables=dbo.fazendas2;uid=db_nucoffee;pwd=@&NuCoFfEe&@'
> using driver `MSSQLSpatial' successful.
> ... and so on!
>
> BUT, when trying a MapServer CGI mode map request like:
> http://my_server/cgi-bin/mapserv.exe?map=e:/my_mapfile.map&mode=map&layers=all&map_size=800+600
> I only got the error:
>
> msDrawMap(): Image handling error. Failed to draw layer named
> 'pol_my_layer'. msOGRFileOpen(): OGR error. Open failed for OGR
> connection in layer `pol_my_layer'. Unable to initialize ODBC
> connection to DSN for my_user/my_passwd at my_dsn, [Microsoft][ODBC
> Driver Manager] Data source name not found and no default driver
> specified
>
> Can anybody give me a clue on that?
>
> My LAYER mapfile part is defined as :
>
> **********************
> LAYER
> NAME "pol_my_layer"
> TYPE POLYGON
> CONNECTIONTYPE OGR
> CONNECTION "<OGRVRTDataSource>
> <OGRVRTLayer name='pol_my_layer'>
> <SrcDataSource>ODBC:my_user/my_passwd at my_dsn</SrcDataSource>
> <SrcLayer>dbo.vw_pol_my_spatial_view</SrcLayer>
> <LayerSRS>WGS84</LayerSRS>
> <GeometryType>wkbUnknown</GeometryType>
> <GeometryField encoding='WKB' field='geom_2005'/>
> </OGRVRTLayer>
> </OGRVRTDataSource>"
> DATA "pol_my_layer"
> FILTER "329"
> FILTERITEM "farm_id"
> PROCESSING "CLOSE_CONNECTION=DEFER"
> END
> ...
> END
More information about the MapServer-users
mailing list