Written by

A J
Question A J · May 27, 2024

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)

Product version: IRIS 2022.1

Comments

Enrico Parisi · May 27, 2024

I'm no Python expert at all, but it looks like user and password are missing. (uid and pwd??)

0
A J  May 27, 2024 to Enrico Parisi

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 

0
Robert Cemper  May 27, 2024 to A J

Win authentication is something
IRIS authentication is something else.
They rarely match each other.

0
Erik Hemdal  Jun 3, 2024 to A J

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.

0