<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta name="Generator" content="Kopano WebApp v3.5.14.2539+111.1">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>QGIS Server on Debian - MSSqlServer layer</title>
</head>
<body>
<!-- begin sanitized html --><p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">Hello everybody,</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">I'm trying to display an MS Sql Server layer with QGIS Server (3.12) installed on a Debian 10 machine.</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><br /></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">The project is giving the "Layer(s) not valid" error, because of the MS Sql Server layer (postgis layers are working properly).</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><br /></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">I've installed the odbc driver, and now I can connect to sql server with ogr2ogr, specifyng "Driver={ODBC Driver 17 for SQL Server}" in the connection string.</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">Than I added a [SQL Server] section to /etc/odbcinst.ini , and now ogr2ogr works without the Driver in the connection string.</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">But QGIS is still giving the <span style="font-size: 13.3333px;">"</span><span style="font-size: 13.3333px;">Layer(s) not valid" error.</span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;"><br /></span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;">I've also tried to add the driver name to the source attribute of the layer-tree-layer element of the qgs file, without success.</span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;"><br /></span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">Three questions:</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">1. What else can I try?</span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;">2. <span style="font-size: 13.3333px;">Is there a way to get more detailed error information? apache error logs are empty, and </span><span style="font-size: 13.3333px;">QGIS_SERVER_LOG_FILE contains just the layer id (</span><span style="font-size: 13.3333px;">QGIS_SERVER_LOG_LEVEL=0 and </span><span style="font-size: 13.3333px;">QGIS_DEBUG=9)</span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;">3. Do you recommend using windows instead of debian in this environment?</span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;"><br /></span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;">Thank you</span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;"><br /></span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;">Regards</span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;"><br /></span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;"><br /></span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;">Francesco</span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;"><br /></span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><span style="font-size: 13.3333px;"><br /></span></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><br /></span></p>
<p style="padding: 0; margin: 0;"><span style="font-size: 10pt; font-family: tahoma, arial, helvetica, sans-serif;"><br /></span></p>
<!-- end sanitized html -->
</body>
</html>