[MapServer-users] Issue with ODBC Connection on 8.2.2 for OGR VRT Layer

Pascoe,Tim (ECCC) Tim.Pascoe at ec.gc.ca
Wed Sep 18 14:12:37 PDT 2024


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20240918/0b0ff416/attachment.htm>


More information about the MapServer-users mailing list