<br><font size=2 face="sans-serif">I have solved the problem by using System
DSN correctly and removing user dsn</font>
<br>
<br><font size=2 face="sans-serif">Thanks very much</font>
<br>
<br><font size=2 face="sans-serif">regards, dejan</font>
<br>
<br><tt><font size=2>Dejan Gambin/GradPula wrote on 27.01.2009 16:23:16:<br>
<br>
> Hi,</font></tt>
<br><tt><font size=2>> <br>
> I need to connect to Access database that has (among the other <br>
> columns) spatial data in two columns named "x coord" and
"y coord". <br>
> I am trying to implement Virtual Spatial Data according to http:<br>
> //www.mapserver.org/input/vector/VirtualSpatialData.html. </font></tt>
<br><tt><font size=2>> <br>
> I have made ovf file like this:</font></tt>
<br><tt><font size=2>> <br>
> <OGRVRTDataSource></font></tt>
<br><tt><font size=2>> <OGRVRTLayer name="krk"></font></tt>
<br><tt><font size=2>> <SrcDataSource>ODBC:@Krk</SrcDataSource></font></tt>
<br><tt><font size=2>> <SrcLayer>baza</SrcLayer></font></tt>
<br><tt><font size=2>> <GeometryType>wkbPoint</GeometryType></font></tt>
<br><tt><font size=2>> <GeometryField
encoding="PointFromColumns" x="x koord" y="y koord"/></font></tt>
<br><tt><font size=2>> </OGRVRTLayer></font></tt>
<br><tt><font size=2>> </OGRVRTDataSource></font></tt>
<br><tt><font size=2>> <br>
> and map file layer like this (using p.mapper):</font></tt>
<br><tt><font size=2>> <br>
> LAYER # kc</font></tt>
<br><tt><font size=2>> CONNECTION "krk.ovf"</font></tt>
<br><tt><font size=2>> CONNECTIONTYPE OGR</font></tt>
<br><tt><font size=2>> NAME "krk"</font></tt>
<br><tt><font size=2>> DATA "krk"</font></tt>
<br><tt><font size=2>> STATUS ON</font></tt>
<br><tt><font size=2>> TYPE POINT</font></tt>
<br><tt><font size=2>> METADATA </font></tt>
<br><tt><font size=2>> "DESCRIPTION" "KC"</font></tt>
<br><tt><font size=2>> "LAYER_ENCODING" "WINDOWS-1250"</font></tt>
<br><tt><font size=2>> END # Metadata </font></tt>
<br><tt><font size=2>> CLASS</font></tt>
<br><tt><font size=2>> Name 'Kc broj'</font></tt>
<br><tt><font size=2>> COLOR 0 0 0</font></tt>
<br><tt><font size=2>> SYMBOL 'circle'</font></tt>
<br><tt><font size=2>> SIZE 10</font></tt>
<br><tt><font size=2>> TEMPLATE void</font></tt>
<br><tt><font size=2>> END # Class</font></tt>
<br><tt><font size=2>> END</font></tt>
<br><tt><font size=2>> <br>
> I have also made use and system dsn connection named "krk".</font></tt>
<br><tt><font size=2>> <br>
> Testing with ogrinfo works fine, for example:</font></tt>
<br><tt><font size=2>> <br>
> C:\Projekti\GIS\WebGIS\podaci\krk>ogrinfo krk.ovf krk|more</font></tt>
<br><tt><font size=2>> ERROR 4: Update access not supported for VRT
datasources.</font></tt>
<br><tt><font size=2>> Had to open data source read-only.</font></tt>
<br><tt><font size=2>> INFO: Open of `krk.ovf'</font></tt>
<br><tt><font size=2>> using driver `VRT' successful.</font></tt>
<br><tt><font size=2>> <br>
> Layer name: krk</font></tt>
<br><tt><font size=2>> Geometry: Point</font></tt>
<br><tt><font size=2>> Feature Count: 2</font></tt>
<br><tt><font size=2>> Extent: (5000450.000000, 4997536.000000) - (5196390.000000,
5000300.000000)</font></tt>
<br><tt><font size=2>> Layer SRS WKT:</font></tt>
<br><tt><font size=2>> ...</font></tt>
<br><tt><font size=2>> ...</font></tt>
<br><tt><font size=2>> <br>
> But trying to run on web I am getting internal server error: <br>
> CGI/FastCGI has encountered a problem and needs to close...".
Also, <br>
> my php error log file says:</font></tt>
<br><tt><font size=2>> <br>
> [27-Jan-2009 16:21:45] PHP Warning: [MapServer Error]: <br>
> msOGRFileOpen(): Open failed for OGR connection `C:<br>
> /Projekti/GIS/WebGIS/podaci/krk/krk.ovf'.</font></tt>
<br><tt><font size=2>> Unable to initialize ODBC connection to DSN for
@Krk,</font></tt>
<br><tt><font size=2>> [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr
failed</font></tt>
<br><tt><font size=2>> <br>
> in C:\ms4w\apps\pmapper\pmapper-3.2.0\incphp\initgroups.php
on line 239</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP Stack trace:</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP 1. {main}()
C:<br>
> \ms4w\apps\pmapper\pmapper-3.2.0\map.phtml:0</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP 2. include_once()
C:<br>
> \ms4w\apps\pmapper\pmapper-3.2.0\map.phtml:51</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP 3. Init_map->initAllParameters()
C:<br>
> \ms4w\apps\pmapper\pmapper-3.2.0\incphp\init\init.php:34</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP 4. Init_map->_initGroups()
C:<br>
> \ms4w\apps\pmapper\pmapper-3.2.0\incphp\init\initmap.php:60</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP 5. Init_groups->Init_groups()
C:<br>
> \ms4w\apps\pmapper\pmapper-3.2.0\incphp\init\initmap.php:292</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP 6. Init_groups->_createGroups()
C:<br>
> \ms4w\apps\pmapper\pmapper-3.2.0\incphp\initgroups.php:48</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP 7. Init_groups->_initResultFields()
C:<br>
> \ms4w\apps\pmapper\pmapper-3.2.0\incphp\initgroups.php:117</font></tt>
<br><tt><font size=2>> [27-Jan-2009 16:21:45] PHP 8. ms_layer_obj->open()
C:<br>
> \ms4w\apps\pmapper\pmapper-3.2.0\incphp\initgroups.php:239</font></tt>
<br><tt><font size=2>> <br>
> Any help would be greatly appreciated</font></tt>
<br><tt><font size=2>> <br>
> Thanks very much</font></tt>
<br><tt><font size=2>> <br>
> regards, dejan</font></tt>