Skip to content
Permalink
Browse files

Merge pull request #91 from szekerest/master

Improve the support for OGR/MSSQL driver
  • Loading branch information
NathanW2 committed Feb 5, 2012
2 parents c933dce + 1be0e87 commit 0c5930f5176fba900cb12e8121d209b73c060f41
@@ -84,6 +84,31 @@ QString createDatabaseURI( QString connectionType, QString host, QString databas
uri += QString( ",password=%1" ).arg( password );
}
}
else if ( connectionType == "MSSQL" )
{
uri = "MSSQL:";

if ( !host.isEmpty() )
{
uri += QString( ";server=%1" ).arg( host );

if ( !port.isEmpty() )
uri += QString( ",%1" ).arg( port );
}

if ( !user.isEmpty() )
{
uri += QString( ";uid=%1" ).arg( user );

if ( !password.isEmpty() )
uri += QString( ";pwd=%1" ).arg( password );
}
else
uri += ";trusted_connection=yes";

if ( !database.isEmpty() )
uri += QString( ";database=%1" ).arg( database );
}
else if ( connectionType == "Oracle Spatial" )
{
uri = "OCI:" + user;
@@ -316,7 +316,10 @@ void QgsOpenVectorLayerDialog::accept()
bool makeConnection = false;
if ( pass.isEmpty() )
{
pass = QInputDialog::getText( this,
if ( cmbDatabaseTypes->currentText() == "MSSQL" )
makeConnection = true;
else
pass = QInputDialog::getText( this,
tr( "Password for " ) + user,
tr( "Please enter your password:" ),
QLineEdit::Password, QString::null,
@@ -1668,6 +1668,10 @@ QString createFilters( QString type )
{
myDatabaseDrivers += QObject::tr( "MySQL" ) + ",MySQL;";
}
else if ( driverName.startsWith( "MSSQL" ) )
{
myDatabaseDrivers += QObject::tr( "MSSQL" ) + ",MSSQL;";
}
else if ( driverName.startsWith( "OCI" ) )
{
myDatabaseDrivers += QObject::tr( "Oracle Spatial" ) + ",OCI;";

0 comments on commit 0c5930f

Please sign in to comment.
You can’t perform that action at this time.