[Qgis-developer] No geometry for sql server

Volker Fröhlich volker27 at gmx.at
Mon May 9 12:14:45 EDT 2011


Dear Christophe!

Have you tried connecting with ogrinfo?

Volker

Am Dienstag 12 April 2011, 12:40:47 schrieb Christophe B:
> Hello,
> 
> We have encountered a problem on version 1.7 of QGIS can support the
> connection to SQL Server 2008.
> 
> When it connects to the base layer does not contain any vector object and
> the attribute table contains the correct columns and many rows, but they
> all contain "ERROR" ...
> 
> One of you has it managed to run this connection?
> 
> Thank you!
> 
> Christophe Baume
> 
> Code :
> 
> the sql table is defined as :
> 
> CREATE TABLE [dbo].[T_CommuneGeographie](
> 
>       [COMGEO_Id] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
> 
>       [COMGEO_Commune_COM_Id] [uniqueidentifier] NOT NULL,
> 
>       [COMGEO_Geographie] [geography] NOT NULL,
> 
>       [COMGEO_DateDebut] [date] NULL,
> 
>       [COMGEO_DateFin] [date] NULL,
> 
> CONSTRAINT [PK_T_CommuneGeographie] PRIMARY KEY CLUSTERED
> 
> (
> 
>       [COMGEO_Id] ASC
> 
> )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY =
> OFF , ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
> 
> ) ON [PRIMARY]
> 
> 
> 
> the lines entered into the python console:
> 
> conn_string =
> "MSSQL:server=.\SQLExpress;database=ObservatoireCommerce;trusted_connection
> =yes;tables=dbo.T_CommuneGeographie(COMGEO_Geographie)"
> 
> qgis.utils.iface.addVectorLayer(conn_string,'test','ogr')



More information about the Qgis-developer mailing list