<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Aptos;}
@font-face
{font-family:"Trebuchet MS";
panose-1:2 11 6 3 2 2 2 2 2 4;}
@font-face
{font-family:wf_segoe-ui_normal;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
p.qt-msonormal1, li.qt-msonormal1, div.qt-msonormal1
{mso-style-name:qt-msonormal1;
margin:0cm;
font-size:11.0pt;
font-family:"Aptos",sans-serif;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:2102755125;
mso-list-template-ids:-1407442004;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Seth,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> I can connect via OGRINFO using the MSSQL driver, after setting the environment variable for:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">MSSQLSPATIAL_USE_GEOMETRY_COLUMNS=NO<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Since the user account for this application does not have CREATE TABLE permissions. The layer is a VRT taken from a non-spatial SQL table (just lat/long columns). Sadly, when accessing the layer via MapServer
through the web application using the full map file, the Create Table error persists.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span lang="EN-CA" style="font-size:11.0pt;font-family:"Trebuchet MS",sans-serif;color:#1F497D">Timothy Pascoe</span></b><b><span lang="EN-CA" style="font-family:"Trebuchet MS",sans-serif;color:#1F497D"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:red">Please note the return to our departmental E-mail address below. My Canada.ca address will also continue to work for the time being/Veuillez noter
le retour à notre adresse électronique départementale ci-dessous. </span><span lang="FR-CA" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:red">Mon adresse Canada.ca continuera également à fonctionner pour le moment.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:#1F497D">Environmental Scientist, Water Quality Monitoring & Surveillance<br>
Environment & Climate Change Canada (ECCC)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><a href="mailto:tim.pascoe@ec.gc.ca"><span lang="FR-CA">tim.pascoe@ec.gc.ca</span></a></span><span lang="EN-CA" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">
</span><span lang="FR-CA" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">T: 905-336-6239 / C: 289-253-7857<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:#1F497D">Scientifique de l’environement, Surveillance de la qualité de l'eau</span><span lang="FR-CA" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA" style="font-size:9.0pt;font-family:"Trebuchet MS",sans-serif;color:#1F497D">Environnement et Changement climatique Canada (ECCC)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><a href="mailto:tim.pascoe@ec.gc.ca"><span lang="FR-CA">tim.pascoe@ec.gc.ca</span></a></span><span lang="EN-CA" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">
</span><span lang="FR-CA" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black">T: 905-336-6239 / C: 289-253-7857<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CA" style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:11.0pt;color:black"><img border="0" width="372" height="20" style="width:3.875in;height:.2083in" id="Picture_x0020_1" src="cid:image001.gif@01DB0A72.25B6D450" alt="Environment Canada"></span><span lang="EN-CA" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Seth G <sethg@geographika.co.uk>
<br>
<b>Sent:</b> Thursday, September 19, 2024 3:00 AM<br>
<b>To:</b> Pascoe,Tim (ECCC) <Tim.Pascoe@ec.gc.ca>; MapServer Users <mapserver-users@lists.osgeo.org><br>
<b>Subject:</b> Re: [MapServer-users] Issue with ODBC Connection on 8.2.2 for OGR VRT Layer<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="width:100.0%">
<tbody>
<tr>
<td width="0" style="width:.3pt;background:#A6A6A6;padding:5.25pt 1.5pt 5.25pt 1.5pt">
</td>
<td width="100%" style="width:100.0%;background:#EAEAEA;padding:5.25pt 3.75pt 5.25pt 11.25pt;aspect-ratio: revert !important;background:revert !important;block-size: revert !important;border:revert !important;bottom: revert !important;color:revert !important;color-scheme: revert !important;content-visibility: revert !important;cursor:revert !important;direction:revert !important;display:revert !important;font-size:revert !important;height:revert !important;hyphens: revert !important;letter-spacing:revert !important;line-height:revert !important;margin:revert !important;opacity: revert !important;order: revert !important;outline: revert !important;overflow:revert !important;padding:revert !important;position:revert !important;resize: revert !important;rotate: revert !important;scale: revert !important;tab-size: revert !important;table-layout:revert !important;text-align:revert !important;text-indent:revert !important;text-orientation: revert !important;text-overflow: revert !important;text-shadow:revert !important;text-transform:revert !important;text-wrap: revert !important;top:revert !important;transition: revert !important;user-select: revert !important;vertical-align:revert !important;visibility:revert !important;white-space:revert !important;width:revert !important;word-break:revert !important;word-spacing:revert !important;writing-mode:revert !important;zoom: revert !important">
<div>
<p class="MsoNormal" style="mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly">
<span style="font-size:9.0pt;font-family:wf_segoe-ui_normal;color:#212121">You don't often get email from
<a href="mailto:sethg@geographika.co.uk">sethg@geographika.co.uk</a>. <a href="https://aka.ms/LearnAboutSenderIdentification">
Learn why this is important</a> <o:p></o:p></span></p>
</div>
</td>
<td width="75" style="width:56.25pt;background:#EAEAEA;padding:5.25pt 3.75pt 5.25pt 3.75pt;aspect-ratio: revert !important;background:revert !important;block-size: revert !important;border:revert !important;bottom: revert !important;color:revert !important;color-scheme: revert !important;content-visibility: revert !important;cursor:revert !important;direction:revert !important;display:revert !important;font-size:revert !important;height:revert !important;hyphens: revert !important;letter-spacing:revert !important;line-height:revert !important;margin:revert !important;opacity: revert !important;order: revert !important;outline: revert !important;overflow:revert !important;padding:revert !important;position:revert !important;resize: revert !important;rotate: revert !important;scale: revert !important;tab-size: revert !important;table-layout:revert !important;text-align:revert !important;text-indent:revert !important;text-orientation: revert !important;text-overflow: revert !important;text-shadow:revert !important;text-transform:revert !important;text-wrap: revert !important;top:revert !important;transition: revert !important;user-select: revert !important;vertical-align:revert !important;visibility:revert !important;white-space:revert !important;width:revert !important;word-break:revert !important;word-spacing:revert !important;writing-mode:revert !important;zoom: revert !important;align: left !important">
</td>
</tr>
</tbody>
</table>
<div>
<div>
<p class="MsoNormal">Hi Tim,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">A couple of suggestions to try.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<ol start="1" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
Can you connect with the same connection string details using ogrinfo?<o:p></o:p></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
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><o:p></o:p></li></ol>
<div>
<p class="MsoNormal">Seth<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div id="sig62266145">
<div>
<p class="MsoNormal">--<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">web:<a href="https://geographika.net/">https://geographika.net</a> & <a href="https://mapserverstudio.net/">https://mapserverstudio.net</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">twitter: @geographika<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">On Wed, Sep 18, 2024, at 11:12 PM, Pascoe, Tim (ECCC) via MapServer-users wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt;overflow-wrap:break-word" id="qt">
<div>
<p class="qt-msonormal1">I’ve spent a fair amount of time trying to track down an ODBC connection issue after upgrading to Mapserver 8.2.2<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1">Platform:<o:p></o:p></p>
<p class="qt-msonormal1">Windows Server 2016<o:p></o:p></p>
<p class="qt-msonormal1">IIS<o:p></o:p></p>
<p class="qt-msonormal1">MS SQL Server 2016<o:p></o:p></p>
<p class="qt-msonormal1">Mapserver 8.2.2 (binaries from GISInternals)<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1">Creating an ODBC connection using the MS administrator works, and the connection test is successful.<o:p></o:p></p>
<p class="qt-msonormal1">The DSN is a System DSN using the ODBC Driver 17 for SQL Server<o:p></o:p></p>
<p class="qt-msonormal1">The user account for the connection is confirmed to have access to the SQL View being used for a VRT layer using OGR<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1">Testing with OGRINFO on the following .ovf file:<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1"><OGRVRTDataSource><o:p></o:p></p>
<p class="qt-msonormal1"> <OGRVRTLayer name='CABINsite'><o:p></o:p></p>
<p class="qt-msonormal1"> <SrcDataSource>ODBC:****/***** @Cabinservice,qryWMSInternal</SrcDataSource><o:p></o:p></p>
<p class="qt-msonormal1"> <SrcSQL>SELECT * FROM qryWMSInternal WHERE sitedetailsid = ****</SrcSQL><o:p></o:p></p>
<p class="qt-msonormal1"> <FID>sitedetailsid</FID><o:p></o:p></p>
<p class="qt-msonormal1"> <GeometryType>wkbPoint</GeometryType><o:p></o:p></p>
<p class="qt-msonormal1"> <LayerSRS>WGS84</LayerSRS><o:p></o:p></p>
<p class="qt-msonormal1"> <GeometryField encoding='PointFromColumns' x='longitude' y='latitude'/><o:p></o:p></p>
<p class="qt-msonormal1"> </OGRVRTLayer><o:p></o:p></p>
<p class="qt-msonormal1"></OGRVRTDataSource><o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1">Generates the error “Failed to open datasource ‘ODBC:****/****…..”<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1">The same test in my production environment, using Mapserver 7.x, connects to the VRT layer and reports as expected.<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1">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?<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1">Thanks,<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
<p class="qt-msonormal1">Tim<o:p></o:p></p>
<p class="qt-msonormal1"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">_______________________________________________<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">MapServer-users mailing list<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="mailto:MapServer-users@lists.osgeo.org">MapServer-users@lists.osgeo.org</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>