And to add what Tom says: you want the pattern in the first example. Well, at least if you want to use an SQL Login + password.
If you want to use integrated security, it is the second example.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am unable to connect SQL Server database from my Julia Language code web server; I suspect I am not able to figure out proper connection string.
I have 2 SQL Server ODBC drivers installed on this windows machine, "SQL Server" and "Microsoft ODBC Driver 17 for SQL Server"
I am able to create DSN manually and at the end DSN setup I am able to connect successfully with these credentials.
I have tried many different connection string, most relevant are following (first line is connection string, second error/exception returned:
Server=my.server.net; User ID=loginname; Password=myPassword; driver={SQL Server}; Database=myDB;
ErrorException("HY000: [Microsoft][ODBC SQL Server Driver][SQL Server]Windows logins are not supported in this version of SQL Server.01S00: [Microsoft][ODBC SQL Server Driver]Invalid connection string attribute")
Server=my.server.net; User ID=loginname; Password=myPassword; driver={ODBC Driver 17 for SQL Server}; Database=myDB;
ErrorException("28000: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user ''.01S00: [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute")
Server=my.server.net; UserID=loginname; Password=myPassword; driver={ODBC Driver 17 for SQL Server}; Database=myDB;
ErrorException("28000: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user ''.01S00: [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute")
Server=my.server.net; User Id=loginname; Password=myPassword; driver={ODBC Driver 17 for SQL Server}; Database=myDB;
ErrorException("28000: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user ''.01S00: [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute")
Server=my.server.net; User Id=loginname; Password=myPassword; driver={ODBC Driver 17 for SQL Server}; Trusted_Connection=False; Database=myDB;
ErrorException("08001: [Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'Trusted_Connection'")
Server=my.server.net; User Id=loginname; Password=myPassword; driver={ODBC Driver 17 for SQL Server}; Trusted_Connection=No; Database=myDB;
ErrorException("28000: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user ''.01S00: [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute")
Server=my.server.net; User Id=loginname; Password=myPassword; driver={ODBC Driver 17 for SQL Server}; Trusted_Connection=Yes; Database=myDB;
ErrorException("FA004: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Failed to authenticate the user '' in Active Directory (Authentication option is 'WindowsIntegrated').\r\nError code 0x534; state 10\r\nNo mapping between account names and security IDs was done.01S00: [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute")
Server=my.server.net; User Id=loginname; Password=myPassword; driver={ODBC Driver 17 for SQL Server}; Trusted_Connection=Yes; Authentication=Server; Database=myDB;
ErrorException("08001: [Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'Authentication'")
Server=my.server.net; User Id=loginname; Password=myPassword; driver={ODBC Driver 17 for SQL Server}; Trusted_Connection=Yes; Authentication=SQLServer; Database=myDB;
ErrorException("08001: [Microsoft][ODBC Driver 17 for SQL Server]Invalid value specified for connection string attribute 'Authentication'")
Any suggestions?
And to add what Tom says: you want the pattern in the first example. Well, at least if you want to use an SQL Login + password.
If you want to use integrated security, it is the second example.
For proper connection strings, please see:
https://www.connectionstrings.com/microsoft-odbc-driver-17-for-sql-server/
Thank you! UID/PWD combination works.
I just got confused with 17/19. I expected (incorrectly) that "ODBC Driver 17 for SQL Server" belongs to "SQL Server 2017".