[Qgis-user] SQL Server Layer - field values not retrieved when using named ODBC DSN

Martin Bain Martin.Bain at lismore.nsw.gov.au
Mon Jul 6 17:17:34 PDT 2015


Our organisation has just migrated from MapInfo TAB files to MS SQL Server Spatial.

I'm using QGIS 2.8.2 to connect with data in a SQL Server 2008 R2 database.

I have noticed unique field values are not retrieved when I create a connection using a previously created ODBC DSN.

When I say "unique field values are not retrieved"  I'm referring to the expression builder window, fields and values, where you have the option to load all unique values or 10 samples.  The same behaviour is also seen in the Attribute Editor form if you set the edit widget for a field to "Unique Values" - the drop down list is empty.

If I create a connection by specifying the Host server name and the Database name it works correctly.

We are using integrated windows authentication.

Perhaps QGIS creates a different connection (different driver?) when you specify the Host server name and the Database name rather than using a premade ODBC connection.

I have three different SQL Server drivers that I can choose from when creating an ODBC connection ("SQL Server"; "SQL Server Native Client 10.0"; "SQL Server Native Client 11.0") it didn't make a difference which one I used.

I don't know if this is a bug or just the way it works.  Perhaps the work around of not using a named DSN will be helpful to others in some situations.

Cheers,
Martin.


This email is intended for the named recipient only.  The information it contains may be confidential.  If you are not the intended recipient you must not reproduce or distribute any part of this email, disclose its contents to any other party or take any action in reliance on it.  If you have received this email in error, please contact the sender immediately and delete the message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150707/56ab4250/attachment.html>


More information about the Qgis-user mailing list