[mapserver-dev] ODBC Connection...

Christian Canales ccanales29 at yahoo.es
Tue Jun 16 16:55:53 EDT 2009


Thanks for you answer Brent...

I have another answer...

I found this page :

http://www.online-archaeology.co.uk/wordpress/?p=10

But in this page appear something about pass a parameter to the SQL Server store procedure :

CONNECTION    "<OGRVRTDataSource>
      <OGRVRTLayer name='POW'>
          <SrcDataSource>ODBC:id/pwd at MyDSN</SrcDataSource> 
   <SrcSQL>EXEC NameofStoredProcedure '%param%'</SrcSQL> 
  <GeometryType>wkbPoint</GeometryType> 
          <LayerSRS>WGS84</LayerSRS>
  <GeometryField encoding='PointFromColumns' x='Longitude' y='Latitude'/> 
      </OGRVRTLayer>
  </OGRVRTDataSource>"
  STATUS      ON
  DATA      POW
.
.
.

But how can I pass the parameter to the store procedure from my page? I supose that I have to create a fields for the data entry, but somebody knows how to code the parameter pass to the mapfile?

Best Regards...

 



________________________________
De: Brent Fraser <bfraser at geoanalytic.com>
Para: Christian Canales <ccanales29 at yahoo.es>
CC: mapserver-dev at lists.osgeo.org; szekerest at gmail.com
Enviado: lunes, 15 de junio, 2009 21:49:56
Asunto: Re: [mapserver-dev] ODBC Connection...

Christian,

  Assuming your ODBC datasource is connecting to your database, you may
need to specify the spatial reference system of your data, either in the
VRT spec below using <LayerSRS>, or in the LAYER object of your map file
with a PROJECTION object.

You could try adding "DEBUG 5" to the layer definition and using shp2img
to see if it reports any errors.

Best Regards,
Brent Fraser




> Hi All...
>
> I'm trying to connect my map with some MS SQL Server data...
>
> So, I'm trying to do it using an ODBC connection via OGR in a *.OVF
> file...
>
> This is the code in the file:
>
> <OGRVRTDataSource>
>    <OGRVRTLayer name="cartracks">
>        <SrcDataSource>ODBC:trak/trakrm at webtrak</SrcDataSource>
>        <SrcSQL>SELECT TOP 1 ID FROM Guardar WHERE ID='53377'</SrcSQL>
>        <GeometryType>wkbPoint</GeometryType>
>        <GeometryField encoding="PointFromColumns" x="Lon" y="Lat"/>
>    </OGRVRTLayer>
> </OGRVRTDataSource>
>
> But I cannot see anything...
>
> Somebody knows what is wrong?
>
> I'm in a Linux environment, with Mapserver 5.4.0 and Chameleon...
>
> Thanks...
>
>
>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
>


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20090616/3786caf6/attachment.html


More information about the mapserver-dev mailing list