Connecting to IRIS Database Using py.odbc
Hi everybody, I am trying to connect with an IRIS database where to retrieve data and import them to SQL server but the access gets denied. I would appreciate your help, Thank you, Jeb
I have following information:
Data Source Name --> I use it as the server name
Host(IP Address)
Port
Namespace --> I could use it in my script
import pyodbc
connection_string = ( "DRIVER={InterSystems IRIS ODBC35};" "SERVER=;" "PORT=;" "DATABASE=________;" "TrustServerCertificate=yes;" )
try: conn = pyodbc.connect(connection_string) print("Connection successful") except pyodbc.Error as ex: sqlstate = ex.args[1] print(f"Connection failed: {sqlstate}")
---- Access Denied (417)
Comments
I'm no Python expert at all, but it looks like user and password are missing. (uid and pwd??)
I use Windows Authentication,
I believe there is no need for Uid or pwd:
But I get the same error when I add them to my script
Win authentication is something
IRIS authentication is something else.
They rarely match each other.
Your Windows user and your IRIS user may be (and often are) different. You need to authenticate to IRIS as well, which is why you need uid and pwd.
why not just use SQLalchemy?