Getting Below Error
OperationalError: ('08001', '[08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. (17) (SQLDriverConnect); [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). (53)'
*** Settings ***
Documentation Simple example using DBLibrary.
Library SeleniumLibrary
Library DatabaseLibrary
*** Variables ***
${DBHost_ConnectionString} 'DRIVER={SQL Server};SERVER="hostname";UID="uname";PWD="******";DATABASE="dbname"'
*** Test Cases ***
Connect Database
Connect To Database Using Custom Params pyodbc ${DBHost_ConnectionString}
I tried all the solutions over internet, like adding port to connection string, appending tcp before servername, e.t.c,
Followed the implementation mentioned in the source code of dbapi
https://github.com/franz-see/Robotframework-Database-Library/blob/master/src/DatabaseLibrary/connection_manager.py
elif dbapiModuleName in ["pyodbc", "pypyodbc"]:
dbPort = dbPort or 1433
logger.info('Connecting using : %s.connect(DRIVER={SQL Server};SERVER=%s,%s;DATABASE=%s;UID=%s;PWD=%s)' % (dbapiModuleName, dbHost, dbPort, dbName, dbUsername, dbPassword))
self._dbconnection = db_api_2.connect('DRIVER={SQL Server};SERVER=%s,%s;DATABASE=%s;UID=%s;PWD=%s' % (dbHost, dbPort, dbName, dbUsername, dbPassword))
Any help should be appreciated.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…