Hi,<br><br>I'm trying to access a point data table using MapServer through OGR VRT driver but I'm having errors.<br><br>My data table is at SQL Server 2000 and I already created a system dns for this database.<br><br>If I run:
<br>$ ogrinfo ODBC:myuser/mypassword@MYDSN -sql &quot;SELECT * FROM PointTable WHERE themonth &gt; 10&quot;<br>this works fine<br><br>But when I try in MapServer:<br><br>&nbsp;&nbsp;&nbsp; LAYER<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CONNECTION &quot;&lt;OGRVRTDataSource&gt;
<br>&nbsp;&nbsp;&nbsp; &lt;OGRVRTLayer name='pts'&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;SrcDataSource&gt;ODBC:myuser/mypassword@MYDSN&lt;/SrcDataSource&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;SrcSQL&gt;SELECT PointTable.* FROM PointTable WHERE themonth &gt; 10&lt;/SrcSQL&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;GeometryField encoding='PointFromColumns' x='Long' y='Lat'/&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/OGRVRTLayer&gt;<br>&lt;/OGRVRTDataSource&gt;&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CONNECTIONTYPE OGR
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DATA &quot;pts&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; NAME &quot;ptsodbc&quot;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; STATUS DEFAULT<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TYPE POINT<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CLASS<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; COLOR 255 0 0<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SIZE 6<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SYMBOL &quot;sym_basic&quot;
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; END<br>&nbsp;&nbsp;&nbsp; END<br clear="all"><br>Then I got:<br>/* -----<br>
msDrawMap(): Image handling error. Failed to draw layer named 'ptsodbc'. <br>
msOGRFileNextShape(): OGR error. SetAttributeFilter() not supported on ExecuteSQL() results. <br>
msEvalContext: Expression parser error. Failed to parse context <br>
msyyparse(): Expression parser error. syntax error <br>--- */<br><br>I only was able to filter data at this point table using FILTER and FILTERITEM keywords at mapfile, but only using regular expressions . Logical expressions does not show any point.
<br><br>Is that something wrong at my connection string or is this a bug to be solved using GDAL CVS ?<br><br>best,<br><br>-- <br>Eduardo Patto Kanegae<br><a href="http://www.webmapit.com.br">http://www.webmapit.com.br</a>