2

I am trying to upload a geopackage (created with ogr2ogr though I don't think that matters) to a MS SQL Server 2008 instance.

I can't access the instance with ogrinfo all I can get is

C:\>ogrinfo -so "MSSQL:server=localhost\EXACTRAKDEVA;database=VectorMapData_2020-02-17;uid=sa;pwd=password"
ERROR 1: Unable to initialize connection to the server for MSSQL:server=localhost\EXACTRAKDEVA;database=VectorMapData_2020-02-17;uid=sa;pwd=password,

Try specifying the driver in the connection string from the list of available drivers:
SQL Server
SQL Server Native Client 10.0
SQL Server Native Client 11.0
ODBC Driver 11 for SQL Server
ODBC Driver 13 for SQL Server
SQL Server Native Client RDA 11.0

ERROR 1: Unable to initialize connection to the server for MSSQL:server=localhost\EXACTRAKDEVA;database=VectorMapData_2020-02-17;uid=sa;pwd=password,

I can't find any clues in the OGR manual page on how to specify a driver in the connection string. I'm also guessing how to manage to connect without a trusted connection, though I have tried user, username as well as uid. I also am not sure what my "server" name is in.

Is there any (easy) way to generate a working connection string using the information available in the SQLServer connection params window?

enter image description here

If that's too hard I'll take a simple explanation of what to put in the QGIS connection boxes instead.

2

Your ogrinfo command is missing trusted_connection=no as shown below. If I run the command below without trusted_connection=no I get exactly the same unhelpful error messages about drivers as you report in your question. The text you need to put after server= will be shown in the server name box when you connect to your server using SQL Management Tools (which I think I can see in the background of one of the images you posted.

ogrinfo -so   MSSQL:server=pcname\servername;database=databasename;trusted_connection=no;UID=username;PWD=password

Connects to my locally hosted SQL Server using OSGeo4W installed with QGIS3.4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.