SQLServer 2005 via ovf

Piero Cavalieri piero.cavalieri at GMAIL.COM
Fri Jul 27 09:29:35 PDT 2007


Bho, I have a connection like this:

CONNECTIONTYPE OGR
  CONNECTION "<OGRVRTDataSource><OGRVRTLayer name='poi'><SrcDataSource>
ODBC:xxx/xxx at gisdevSql2005</SrcDataSource>
<SrcLayer>top025sc</SrcLayer>
<GeometryField encoding='WKB' field='the_geom'/> <SrcSQL>SELECT * FROM
top025sc WHERE TOP_CL = 'T110' or TOP_CL = 'T115'
</SrcSQL>
</OGRVRTLayer></OGRVRTDataSource>"

And a System DSN and it's working.

Here is different:
<SrcDataSource>ODBC:xxx/xxx at gisdevSql2005</SrcDataSource>

Where gisdevSql2005 is the DSN,
And u have:
<SrcDataSource>ODBC:usr/pwd at ourdb,table_name</SrcDataSource>

Which is different syntax. Try as my syntax, maybe it works.

Cheers
 Piero



2007/7/26, Josh Hevenor <Josh.Hevenor at dpra.com>:
>
>  I'm trying to connect to a SQLServer 2005 table through OVF with little
> success…
>
>
>
> My OVF file
>
>
>
>             <OGRVRTDataSource>
>
>     <OGRVRTLayer name="banner_location">
>
>         <SrcDataSource>ODBC:usr/pwd at ourdb,table_name</SrcDataSource>
>
>                   <SRCLayer>table_name</SRCLayer>
>
>                               <GeometryType>wkbPoint</GeometryType>
>
>                               <GeometryField encoding="PointFromColumns"
> x="LONGITUDE" y="LATITUDE"/>
>
>     </OGRVRTLayer>
>
> </OGRVRTDataSource>
>
>
>
> Our mapfile just has a background (province) polygon layer and this point
> layer. When I use shp2img there is no error reported but my points aren't on
> the image.
>
>
>
>             shp2img -m geoportal.map -o testing.png
>
> msDrawMap(): Layer 0 (Province), 0.172s
>
> msDrawMap(): Layer 1 (Major Roads), 0.046s
>
> msDrawMap(): Layer 2 (our_layer), 7.157s         // the ovf layer
>
> msDrawMap(): Drawing Label Cache, 0.000s
>
> msDrawMap() total time: 7.375s
>
>
>
> I can use mapserv.exe to draw a map when the ovf layer is turned off. When
> I attempt to connect through mapserver (mapscript, php) I get the following
> error
>
>
>
>             [MapServer Error]: msOGRFileOpen(): Open failed for OGR
> connection `..\..\common\data\ovf\our_layer.ovf'.
>
> Unable to initialize ODBC connection to DSN for usr/pwd at ourdb,table_name,
>
> [Microsoft][SQL Native Client]Named Pipes Provider: Could not open a
> connection to SQL Server [1326].
>
>
>
> When I use the 'Sql Server' odbc driver in the connection I get the
> following for line 3 instead of the Named Pipes stuff
>
>
>
>             [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does
> not exist or access denied.
>
>
>
> I'm using PHP 5.2.3 and MapServer version 4.10.2
>
>
>
> OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF
> OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
> SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS
> SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
> DEBUG=MSDEBUG
>
>
>
> Any suggestions are much appreciated,
>
>
>
> Josh Hevenor
> Application Developer
> ____________________________________________
> 5230 South Service Road
> Burlington, Ontario
> L7L 5K2  Canada
> Phone: 905-333-4544 ext. 19
> Fax: 905-333-0455
> Cell: 905-320-7525*
> **Email: josh.hevenor at dpra.com**
> *Internet: http://www.dpra.com*
> *
>
>
>
>
>
>
> *Attention:**
> *Privileged/Confidential Information may be contained in this message.
> Disclosure to any person other than the named recipient is unauthorized. If
> you are not the intended recipient, please delete all copies of this
> information and kindly notify the sender by reply email. Opinions,
> conclusions and other information in this message that do not relate to the
> official business of DPRA shall be understood as neither given nor endorsed
> by it. DPRA and any of its subsidiaries reserve the right to monitor all
> e-mail communications through its networks. Thank you.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070727/ca30befa/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 3247 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070727/ca30befa/attachment.jpg>


More information about the MapServer-users mailing list