<!DOCTYPE html><html><head><title></title><style type="text/css">#qt p.qt-MsoNormal{margin-top:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:0cm;font-size:11pt;font-family:"Aptos", sans-serif;}
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Hi Tim,<br></div><div><br></div><div>A couple of suggestions to try.<br></div><div><br></div><ol><li>Can you connect with the same connection string details using ogrinfo?<br></li><li>Are you able to test with the MSSQL driver in GDAL? <a href="https://gdal.org/en/latest/drivers/vector/mssqlspatial.html">https://gdal.org/en/latest/drivers/vector/mssqlspatial.html</a><br></li></ol><div>Seth<br></div><div><br></div><div id="sig62266145"><div class="signature">--<br></div><div class="signature">web:<a href="https://geographika.net">https://geographika.net</a> & <a href="https://mapserverstudio.net">https://mapserverstudio.net</a><br></div><div class="signature">twitter: @geographika<br></div></div><div><br></div><div>On Wed, Sep 18, 2024, at 11:12 PM, Pascoe, Tim (ECCC) via MapServer-users wrote:<br></div><blockquote type="cite" id="qt" style="overflow-wrap:break-word;"><div class="qt-WordSection1"><p class="qt-MsoNormal">I’ve spent a fair amount of time trying to track down an ODBC connection issue after upgrading to Mapserver 8.2.2<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">Platform:<br></p><p class="qt-MsoNormal">Windows Server 2016<br></p><p class="qt-MsoNormal">IIS<br></p><p class="qt-MsoNormal">MS SQL Server 2016<br></p><p class="qt-MsoNormal">Mapserver 8.2.2 (binaries from GISInternals)<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">Creating an ODBC connection using the MS administrator works, and the connection test is successful.<br></p><p class="qt-MsoNormal">The DSN is a System DSN using the ODBC Driver 17 for SQL Server<br></p><p class="qt-MsoNormal">The user account for the connection is confirmed to have access to the SQL View being used for a VRT layer using OGR<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">Testing with OGRINFO on the following .ovf file:<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal"><OGRVRTDataSource><br></p><p class="qt-MsoNormal"> <OGRVRTLayer name='CABINsite'><br></p><p class="qt-MsoNormal"> <SrcDataSource>ODBC:****/***** @Cabinservice,qryWMSInternal</SrcDataSource><br></p><p class="qt-MsoNormal"> <SrcSQL>SELECT * FROM qryWMSInternal WHERE sitedetailsid = ****</SrcSQL><br></p><p class="qt-MsoNormal"> <FID>sitedetailsid</FID><br></p><p class="qt-MsoNormal"> <GeometryType>wkbPoint</GeometryType><br></p><p class="qt-MsoNormal"> <LayerSRS>WGS84</LayerSRS><br></p><p class="qt-MsoNormal"> <GeometryField encoding='PointFromColumns' x='longitude' y='latitude'/><br></p><p class="qt-MsoNormal"> </OGRVRTLayer><br></p><p class="qt-MsoNormal"></OGRVRTDataSource><br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">Generates the error “Failed to open datasource ‘ODBC:****/****…..”<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">The same test in my production environment, using Mapserver 7.x, connects to the VRT layer and reports as expected.<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">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?<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">Thanks,<br></p><p class="qt-MsoNormal"> <br></p><p class="qt-MsoNormal">Tim<span lang="EN-CA" style="color:rgb(31, 73, 125);"><span class="font" style="font-family:"Calibri", sans-serif;"></span></span><br></p><p class="qt-MsoNormal"> <br></p></div><div>_______________________________________________<br></div><div>MapServer-users mailing list<br></div><div><a href="mailto:MapServer-users@lists.osgeo.org">MapServer-users@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div><div><br></div></blockquote><div><br></div></body></html>