I don't have experience with this so I might be wrong, but you say this works:
Then in your python source you say:
But in the previous (working) example, "dbo.tblCountry" was the name of a table. Not a database. So to do the same as in the (working) example I guess you should do:
Note: the parameter you specify is just passed through to the ODBC handler, so it is one quoted parameter. If you need to pass more parameters, it should still be one parameter in Python:
(Don't add unnecessary spaces.)
abc <- odbcConnect("asa")
. So what is "asa"? I guess it is a DSN. And apparently you do not have to specify username and password, so I guess this information is stored in the DSN.Then in your python source you say:
1 2 |
server = 'asa' db = 'dbo.tblCountry' |
1 |
conn = pyodbc.connect( "DSN=asa" ) |
1 |
conn = pyodbc.connect( "DSN=MSSQLServerDatabase;UID=myuid;PWD=mypwd" ) |