Sql Server connection string in ODBC.jl

I use this code to connect to a Sql Server database, with no credentials
All good!

    ODBC.adddsn("SQL_Server_DSN", "SQL Server"; SERVER="x", DATABASE ="x", Trusted_Connection="True")
	conn = DBInterface.connect(ODBC.Connection, "SQL_Server_DSN")
	cursor = DBInterface.execute(conn, "SELECT * FROM dbo.users")|> DataFrame

But when I try to use credentials, somehow I am not able to get how to adapt the connection string.

Hi,

I found this thread whilst trying to find how to iterate over a cursor from a ODBC connection. Would you know how to do that as opposed to piping direct to a DataFrame?

also - to your original question:
replace “Trusted_Connection” with UID=“x”;PWD=“x”

and it should work.

taken from Connection strings website and just worked on my windows machine.

Regards,

1 Like

Thank you!
I figured it back then.
Still strange that I got no answer for such a long time…