[gdal-dev] Re: [mapserver-users] OGRinfo works, but a MapServer test mode=map DOES NOT

Brent Fraser bfraser at geoanalytic.com
Thu May 26 10:14:10 EDT 2011


Eduardo,

   What happens when you use ogrinfo to access it via ODBC:

ogrinfo ODBC:my_user/my_passwd at my_dsn

or if you put the connection in a vrt file and use ogrinfo on it?

Best Regards,
Brent Fraser


On 5/26/2011 4: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
> **********************
>
> best regards,
>
> --
> Eduardo Patto Kanegae
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



More information about the gdal-dev mailing list