Sorry for the comma instead of semicolon. I was retyping it from another machine so it was just a typo here.
What in fact helped was to add those three options:
Authentication=SqlPassword; Trusted_Connection=no;Encrypt=no;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello
I am trying to connect to SQL Server using C program on Linux. Server's IP is 192.168.0.25 and Port is 52000.
I can connect to it using below:
isql test ud pw -v
My connection string is this:
DRIVER = {ODBC Driver 17 for SQL Server}; Server = 192.168.0.25,52000;Database = db; UID = ud, PWD = pw;
When I want to perform a test connection, I get this error:
[unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Login failed for user ''
Something must be wrong with the connection string because it shows empty user '', not 'ud' as in the string above. Why it does not pass my credentials?
I'll be grateful for any help
Sorry for the comma instead of semicolon. I was retyping it from another machine so it was just a typo here.
What in fact helped was to add those three options:
Authentication=SqlPassword; Trusted_Connection=no;Encrypt=no;
Your connection string look good so far: https://www.connectionstrings.com/microsoft-odbc-driver-17-for-sql-server/
Do you see any details about the failed login attempt in SQL Server ErrorLog file?
View the SQL Server error log in SQL Server Management Studio (SSMS)
Hi @Arek ,
Please try below connection string;
DRIVER = {ODBC Driver 17 for SQL Server}; Server = 192.168.0.25,52000;Database = db; UID = ud; PWD = pw;
Quote from the blog Microsoft ODBC Driver 17 for SQL Server connection strings.
If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.