Hi Tim,

A couple of suggestions to try.

 1. Can you connect with the same connection string details using ogrinfo?
 2. Are you able to test with the MSSQL driver in GDAL? 
https://gdal.org/en/latest/drivers/vector/mssqlspatial.html
Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Wed, Sep 18, 2024, at 11:12 PM, Pascoe, Tim (ECCC) via MapServer-users wrote:
> I’ve spent a fair amount of time trying to track down an ODBC connection 
> issue after upgrading to Mapserver 8.2.2
>  
> Platform:
> Windows Server 2016
> IIS
> MS SQL Server 2016
> Mapserver 8.2.2 (binaries from GISInternals)
>  
> Creating an ODBC connection using the MS administrator works, and the 
> connection test is successful.
> The DSN is a System DSN using the ODBC Driver 17 for SQL Server
> The user account for the connection is confirmed to have access to the SQL 
> View being used for a VRT layer using OGR
>  
> Testing with OGRINFO on the following .ovf file:
>  
> <OGRVRTDataSource>
>                                 <OGRVRTLayer name='CABINsite'>
>                                                 
> <SrcDataSource>ODBC:****/***** @Cabinservice,qryWMSInternal</SrcDataSource>
>                                                 <SrcSQL>SELECT * FROM 
> qryWMSInternal WHERE sitedetailsid = ****</SrcSQL>
>                                     <FID>sitedetailsid</FID>
>                                                 
> <GeometryType>wkbPoint</GeometryType>
>                                                 <LayerSRS>WGS84</LayerSRS>
>                                 <GeometryField encoding='PointFromColumns' 
> x='longitude' y='latitude'/>
>                                 </OGRVRTLayer>
> </OGRVRTDataSource>
>  
> Generates the error “Failed to open datasource ‘ODBC:****/****…..”
>  
> The same test in my production environment, using Mapserver 7.x,  connects to 
> the VRT layer and reports as expected.
>  
> Anyone have something else I can look for? I’ve seen a number of posts in 
> various forums with similar issues, but they all seem to resolve with an 
> error in the connection string. Since I’m sure the format/credentials is 
> correct, I’m not sure where else to look. Is there a change in how OGR/GDAL 
> operates in the 8.2.2 binaries I have (security changes?) that would result 
> in this issue?
>  
> Thanks,
>  
> Tim
>  
> _______________________________________________
> MapServer-users mailing list
> [email protected]
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
_______________________________________________
MapServer-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to