<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; } @font-face {
font-family: Cambria Math;
}
@font-face {
font-family: Calibri;
}
@font-face {
font-family: Consolas;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0cm 0cm 0pt; color: black; font-family: "Times New Roman",serif; font-size: 12pt; } a:link, span.MsoHyperlink { color: blue; text-decoration: underline; } a:visited, span.MsoHyperlinkFollowed { color: purple; text-decoration: underline; } pre { margin: 0cm 0cm 0pt; color: black; font-family: "Courier New"; font-size: 10pt; } span.HTMLPreformattedChar { color: black; font-family: Consolas; } span.EmailStyle20 { color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; } span.EmailStyle21 { color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; } span.EmailStyle22 { color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; } p.HTML-esimuotoiltu, li.HTML-esimuotoiltu, div.HTML-esimuotoiltu { margin: 0cm 0cm 0pt; color: black; font-family: "Times New Roman",serif; font-size: 12pt; } span.HTML-esimuotoiltuChar { color: black; font-family: Consolas; } span.EmailStyle25 { color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; } span.EmailStyle26 { color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; } .MsoChpDefault { font-size: 10pt; } div.WordSection1 { }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<div style="color: rgb(33, 33, 33);">
<div>
<div class="WordSection1"></div>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">Hi</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"></span> </p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">I manually retyped the connection string into my Mapfile and still get the same error. The exact same connection string works fine in ogrinfo, the
only error message is something about OGC Metadata table missing, however, it proceeds to give me the correct information.</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"></span> </p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">Thanks,</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"><br>
Robert</span></p>
<div class="WordSection1"></div>
<div class="WordSection1">
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(225, 225, 225) currentColor currentColor; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span lang="EN-US" style="color: windowtext; font-family: "Calibri",sans-serif; font-size: 11pt;">From:</span></b><span lang="EN-US" style="color: windowtext; font-family: "Calibri",sans-serif; font-size: 11pt;"> Rahkonen Jukka (MML)
[mailto:jukka.rahkonen@maanmittauslaitos.fi] <br>
<b>Sent:</b> Wednesday, 11 May 2016 7:28 p.m.<br>
<b>To:</b> geographika@gmail.com; Robert Sanson <Robert.Sanson@asurequality.com>; mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapserver-users] Mapserver - connection to MSSQL</span></p>
</div>
</div>
<div class="WordSection1"></div>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">Hi,</span></p>
<div class="WordSection1"></div>
<p class="MsoNormal"><span lang="EN-US" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">The connection string in the mapfile does look perfect but something that happens for me is that if I copy and paste text the copy may
contain invisible characters which make troubles. I would rewrite the CONNECTION again by hand from keyboard and try if it helps.</span></p>
<div class="WordSection1"></div>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">-Jukka Rahkonen-</span></p>
<div class="WordSection1"></div>
<div class="WordSection1">
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(225, 225, 225) currentColor currentColor; padding: 3pt 0cm 0cm;">
<p class="MsoNormal" style="margin-bottom: 12pt;"><span lang="FI" style="color: windowtext; font-family: "Calibri",sans-serif; font-size: 11pt;">Seth G wrote:</span></p>
</div>
</div>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<br>
<br>
The error message indicates there is a problem with your connection string:<br>
<br>
'MSSQL:driver=FreeTDS;server=db-agribase-p.asu</span><span lang="FI">requality.com' does not contain the 'database' portion</span><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"><br>
<br>
If the database part is not missing, maybe there is a missing semi-colon, or special character ending the database connection string?<br>
<br>
Regards,<br>
<br>
Seth<br>
<br>
</span><span lang="FI">On 10/05/2016 23:54, Robert Sanson wrote:</span></p>
</div>
<div class="WordSection1"></div>
<blockquote class="WordSection1" style="margin-top: 5pt; margin-bottom: 5pt;">
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">Hi</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">I am trying to create a Mapserver (v 6.4.1 on Ubuntu) layer based on a MSSQL table with native geometry.</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">I have tested the connection via ogrinfo (based on gdal v 2.0.2) and it works:</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">ogrinfo -sql "select * from par_table where par_no = 6777887" "MSSQL:driver=FreeTDS;server=myserver,1433;uid=xx;pwd=xxx;database=mydb;trusted_connection=no;tables=par_table(geom)"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">This is my layer section:</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">LAYER</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> NAME par_direct</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> GROUP "CRS"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> STATUS ON</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> CONNECTIONTYPE ogr</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> CONNECTION "MSSQL:driver=FreeTDS;server=myserver,1433;uid=xx;pwd=xxx;database=mydb;trusted_connection=no;tables=par_table(geom)"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> FILTER "WHERE date_dropped is null"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> TYPE POLYGON</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> PROCESSING 'CLOSE_CONNECTION=DEFER'</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> MAXSCALE 275000</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> CLASS</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> STYLE</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> WIDTH 0.25</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> OUTLINECOLOR 0 0 255</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> END</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> END</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> METADATA</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> "ows_title" "par_direct"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> "wms_group_title" "CRS"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> "wms_exceptions_format" "application/vnd.ogc.se_xml"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> "wms_abstract" "This is the LINZ parcel layer in NZTM"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> "wms_keywordlist" "LINZ,CRS"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> "wms_extent" "1114412.940 4793178.168 2089186.204 6190213.601"</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> END</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">END</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">When I try a WMS getmap call I get this error message:</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"><?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?></span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"><!DOCTYPE ServiceExceptionReport SYSTEM
<a href="http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">"http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd"</a>></span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"><ServiceExceptionReport version="1.1.1"></span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"><ServiceException></span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">msDrawMap(): Image handling error. Failed to draw layer named 'par_direct'.</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `par_direct'.</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">'MSSQL:driver=FreeTDS;server=db-agribase-p.asurequality.com' does not contain the 'database' portion</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"></ServiceException></span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"></ServiceExceptionReport></span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
</blockquote>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"></span><span lang="FI"></span> </p>
<blockquote class="WordSection1" style="margin-top: 5pt; margin-bottom: 5pt;">
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">Many thanks,</span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span><span lang="FI"></span></p>
<p class="MsoNormal"><span lang="FI" style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">Robert L. Sanson</span><span lang="FI"></span></p>
<p class="MsoNormal" style="margin-bottom: 12pt;"><span lang="FI"></span> </p>
</blockquote>
<div class="WordSection1"></div>
<p class="WordSection1"><span lang="FI"> </span></p>
<div class="WordSection1"></div>
</div>
</div>
</body>
</html>