Pietro,<br><br>I doubt it it&#39;s a C# specific issue. Actually mapserver use MS_MAXPATHLEN=1024 as the upper limit of the length of the file pathes. In this case it seems something like SHAPEPATH is already definied in your mapfile which is concatenated with the connection string by the mapserver ogr driver. In this regard I don&#39;t see any reason why PHP mapscript behaves differently (assuming you define SHAPEPATH in both cases).<br>
<br>I think however the OGR driver should also consider the connection is not always define a physical path actually so this might be a issue to be handled.<br><br><br>Best regards,<br><br>Tamas<br><br><br><br><br><br><div class="gmail_quote">
2009/1/23 Pietro Giannini <span dir="ltr">&lt;<a href="mailto:pgiannini@bytewise.it">pgiannini@bytewise.it</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi list.<br>
<br>
I found a strange error in c# mapscript on drawing a map image when a<br>
layer has a virtual spatial data connection.<br>
<br>
The error is:<br>
System.ApplicationException was unhandled by user code<br>
 &nbsp;Message=&quot;msBuildPath(): Unable to access file.<br>
(C:\\svil\\EMS\\map\\&lt;OGRVRTDataSource&gt;\n&lt;OGRVRTLayer<br>
name=&#39;object&#39;&gt;\n&lt;SrcDataSource&gt;ODBC:sa/Password123@EMS_object&lt;/SrcDataSource&gt;\n&lt;SrcLayer&gt;object&lt;/SrcLayer&gt;\n&lt;FID&gt;Id&lt;/FID&gt;\n&lt;SrcSQL&gt;\nSELECT<br>
Dim_Unit.Id, Dim_Unit.Description, Dim_Unit.Icon AS Icon, [...] FROM<br>
Dim_Unit WHERE Dim_Unit.Id [...]<br>
&lt;/SrcSQL&gt;\n&lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;\n&lt;GeometryField<br>
encoding=&#39;PointFromColumns&#39; x=&#39;LON&#39;<br>
y=&#39;LAT&#39;/&gt;\n&lt;/OGRVRTLayer&gt;\n&lt;/OGRVRTDataSource&gt;: path is too long&quot;<br>
 &nbsp;Source=&quot;mapscript_csharp&quot;<br>
<br>
([...] = omissis due to lenght of the query)<br>
<br>
the error occurs only:<br>
- in mapscript_csharp, I tried with php_mapscript and it does not occur;<br>
- if the ovf connection string is INLINE at layer level, when I use the<br>
classic .ovf file it does not occur;<br>
- if the ovf connection string is longer than 1022 characters (!)<br>
<br>
other infos, if useful:<br>
- ODBC connection to a MS SQLserver 2005;<br>
- development in <a href="http://ASP.NET" target="_blank">ASP.NET</a> (VS2005), the deploy environment is a Share Point<br>
portal, the application is embedded in a WebPart.<br>
<br>
Any idea?<br>
many thanks<br>
bye ..................................pg<br>
<br>
<br>
<br>
--<br>
Pietro Giannini<br>
Bytewise srl - Area GIS<br>
41°50&#39;38.58&quot;N 12°29&#39;13.39&quot;E<br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</blockquote></div><br>