soda-core
soda-core copied to clipboard
Error connection with SQL and param string Trusted_Connection=True
Hi everyone, I found an issue when building the string connection with sql on the module: sqlserver_data_source.py
When the connection is trusted, you dont need user and pass, so the solution could be: (the last two lines were added)
self.connection = pyodbc.connect( ("Trusted_Connection=YES;" if self.trusted_connection else "") + ("TrustServerCertificate=YES;" if self.trust_server_certificate else "") + ("Encrypt=YES;" if self.encrypt else "") + "DRIVER={" + self.driver + "};SERVER=" + self.host + "," + str(self.port) + ";DATABASE=" + self.database + (";UID=" + self.username if not self.trusted_connection else "") + (";PWD=" + self.password if not self.trusted_connection else "") )
Many thanks guys for the job done, i am starting to use it and i like it :)
SAS-2143
Thank you for the report @rodrigomartinez1302 ! Would you like to open a PR with the fix? I'll be happy to merge it ASAP.
Hi, Is this issue fixed ?
Not yet, would you be able to open a PR for this @rodrigomartinez1302 ?