[mapserver-users] Mapserver - connection to MSSQL
Tamas Szekeres
szekerest at gmail.com
Tue May 31 11:35:55 PDT 2016
Robert,
It looks like the port number portion in the connection string causes the
issue, specifically the comma is not being interpreted correctly by the
parser. I guess this is similar to an earlier issue reported to gdal:
https://trac.osgeo.org/gdal/ticket/4885
That time quoting the connection string provided a workaround as far as I
remember.
Best regards,
Tamas
2016-05-12 22:44 GMT+02:00 Robert Sanson <Robert.Sanson at asurequality.com>:
> Hi
>
>
>
> I manually retyped the connection string into my Mapfile and still get the
> same error. The exact same connection string works fine in ogrinfo, the
> only error message is something about OGC Metadata table missing, however,
> it proceeds to give me the correct information.
>
>
>
> Thanks,
>
>
> Robert
>
> *From:* Rahkonen Jukka (MML) [mailto:jukka.rahkonen at maanmittauslaitos.fi]
> *Sent:* Wednesday, 11 May 2016 7:28 p.m.
> *To:* geographika at gmail.com; Robert Sanson <Robert.Sanson at asurequality.com>;
> mapserver-users at lists.osgeo.org
> *Subject:* Re: [mapserver-users] Mapserver - connection to MSSQL
>
> Hi,
>
> The connection string in the mapfile does look perfect but something that
> happens for me is that if I copy and paste text the copy may contain
> invisible characters which make troubles. I would rewrite the CONNECTION
> again by hand from keyboard and try if it helps.
>
> -Jukka Rahkonen-
>
> Seth G wrote:
>
> Hi,
>
> The error message indicates there is a problem with your connection string:
>
> 'MSSQL:driver=FreeTDS;server=db-agribase-p.asurequality.com' does not
> contain the 'database' portion
>
> If the database part is not missing, maybe there is a missing semi-colon,
> or special character ending the database connection string?
>
> Regards,
>
> Seth
>
> On 10/05/2016 23:54, Robert Sanson wrote:
>
> Hi
>
>
>
> I am trying to create a Mapserver (v 6.4.1 on Ubuntu) layer based on a
> MSSQL table with native geometry.
>
>
>
> I have tested the connection via ogrinfo (based on gdal v 2.0.2) and it
> works:
>
>
>
> ogrinfo -sql "select * from par_table where par_no = 6777887"
> "MSSQL:driver=FreeTDS;server=myserver,1433;uid=xx;pwd=xxx;database=mydb;trusted_connection=no;tables=par_table(geom)"
>
>
>
> This is my layer section:
>
>
>
> LAYER
>
> NAME par_direct
>
> GROUP "CRS"
>
> STATUS ON
>
> CONNECTIONTYPE ogr
>
> CONNECTION
> "MSSQL:driver=FreeTDS;server=myserver,1433;uid=xx;pwd=xxx;database=mydb;trusted_connection=no;tables=par_table(geom)"
>
> FILTER "WHERE date_dropped is null"
>
> TYPE POLYGON
>
> PROCESSING 'CLOSE_CONNECTION=DEFER'
>
> MAXSCALE 275000
>
> CLASS
>
> STYLE
>
> WIDTH 0.25
>
> OUTLINECOLOR 0 0 255
>
> END
>
> END
>
> METADATA
>
> "ows_title" "par_direct"
>
> "wms_group_title" "CRS"
>
> "wms_exceptions_format" "application/vnd.ogc.se_xml"
>
> "wms_abstract" "This is the LINZ parcel layer in NZTM"
>
> "wms_keywordlist" "LINZ,CRS"
>
> "wms_extent" "1114412.940 4793178.168 2089186.204 6190213.601"
>
> END
>
> END
>
>
>
> When I try a WMS getmap call I get this error message:
>
>
>
> <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
>
> <!DOCTYPE ServiceExceptionReport SYSTEM
> "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd"
> <http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd>>
>
> <ServiceExceptionReport version="1.1.1">
>
> <ServiceException>
>
> msDrawMap(): Image handling error. Failed to draw layer named
> 'par_direct'.
>
> msOGRFileOpen(): OGR error. Open failed for OGR connection in layer
> `par_direct'.
>
> 'MSSQL:driver=FreeTDS;server=db-agribase-p.asurequality.com' does
> not contain the 'database' portion
>
> </ServiceException>
>
> </ServiceExceptionReport>
>
>
>
>
>
> Many thanks,
>
>
>
> Robert L. Sanson
>
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160531/cc9f4cec/attachment.htm>
More information about the MapServer-users
mailing list