Connect to SQL Server using GORM and Windows Authentication - sql-server

I am trying to connect to a SQL Server database using gorm. I am able to connect through Golang datasource with the following connection string:
jdbc:jtds:sqlserver://{HOST}:1433/{DATABASE_NAME};useNTLMv2=true;domain={DOMAIN};encrypt=true;trustServerCertificate=true;instance={INSTANCE}
I am trying the following dsn value in gorm:
sqlserver://{USER}:{PASS}#{HOST}:1433?database={DATABASE_NAME};trusted+connection=yes
But I am getting login failed, am I missing something?

Related

Filemaker Pro MS SQL Server ODBC Driver Connection Failure

I am trying to connect to one of my MS SQL Server databases with the Filemaker Pro ODBC driver. I am using the database service. However, whenever I try to connect to my database it sends either an error that it can't connect to the datasource or an error that the username or password is incorrect. I know the credentials I am using are correct because I can connect to my Jetbrains IDE and to the mssql library in node.js with the same credentials. Does anyone know what the problem could be? My database is running on Azure. Do any setting need to be changed in the driver based on using Azure that could cause the problem?

How to connect JDBC to Microsoft SQL Server in JMeter?

How to connect JDBC to Microsoft SQL Server so that I can test my SQL Server database in JMeter.
I am using Apache Jmeter 2.13. I have put the sqljdbc4.jar file in JMeter/lib folder. I also created a very simple database in Microsoft SQL Server Management Studio where my server name is localhost and I have used windows authentication to connect to my server. Then in JMeter I have used the following properties in JDBC Connection Configuration :
Database URL:jdbc:sqlserver://localhost:1433;DatabaseName=JmeterTestDatabase.
JDBC Driver Class:com.microsoft.sqlserver.jdbc.SQLServerDriver.
Username:ABC-PC\ABC.
Password: Somepassword.
When I run the test I get the following error:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user
'ABC-PC\ABC'. ClientConnectionId:7c9e308b-1bdc-4513-8386-5bc51f249029
What is going wrong here?
Log in failed is a clear message we are seeing , please check it once again.
TRY this as well, I have given below by assuming username as "ABC-PC\ABC" and password as "Somepassword" change accordingly.
Database URL:jdbc:sqlserver://ABC-PC\ABC/Somepassword#localhost:1433;DatabaseName=JmeterTestDatabase.
JDBC Driver Class:com.microsoft.sqlserver.jdbc.SQLServerDriver.

How to create a new ODBC connection to one remote SQL Server

I'm trying to run an application that I've developped recently. This one uses an ODBC connection to browse a defined database.
I'm trying to execute this app from a remote computer. Using VMWare, I've created a new Windows 7 environment and connected on. After that I've tried to create a new System DSN, but, when I set the logins that I'm using to connect on my local SQL Server 2008 I get
Connection failed: SQLState: '28000' SQL Server Error: 18452
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed. The login
is from an untrusted domain and cannot be used with Windows
authentication.
How may I to deal with this, please?
Thanks a lot!
You will have to use SQL Server authentication to connect or add the local machine to the same domain where the server is.
http://msdn.microsoft.com/en-us/library/ms144284.aspx

SQL server 2008 login issue

Hi I created a new login SQL server authentication in SQL server 2008, however I am unable to login with that user.
Getting an error like ,
TITLE: Connect to Server
Cannot connect to (local).
ADDITIONAL INFORMATION:
Login failed for user 'sa'. (Microsoft SQL Server, Error: 18456)
The error Login failed for user 'sa' means that connection to server was established, but server refused it under certain circumstances, such as:
Wrong password
Sql server uses only Windows Authentication (needs server restart)
In your Connection String you ask to connect to specified DB, which is not exists
sa login is Disabled or Denied to access sql engine
User Action
If you are trying to connect using SQL Server Authentication, verify
that SQL Server is configured in Mixed Authentication Mode.
If you are trying to connect using SQL Server Authentication, verify
that SQL Server login exists and that you have spelled it properly.
If you are trying to connect using Windows Authentication, verify
that you are properly logged into the correct domain.
If your error indicates state 1, contact your SQL Server
administrator.
From this article
Should this not help try troubleshooting this issue following these steps.

How do I connect to SQL Server using OLEDB using Windows Authentication connection string

I have SQL Server 2010 running in windows auth mode and the proper groups have been assigned. I can connect via the SQL Server Client Studio using windows auth. That works. But when connecting using .NET OLEDB connections it fails and I can't figure out why.
Here is the string:
data source=172.20.0.113;initial catalog=ForgeEnterprise;Integrated Security=SSPI;multipleactiveresultsets=True;App=EntityFramework
And here is the error:
Login failed for user 'MOMENTUMI\jmcclure'
Is there something I'm missing?
According to http://connectionstrings.com/sql-server-2008 this should do the trick
Provider=SQLNCLI10;Server=172.20.0.113;Database=ForgeEnterprise;Trusted_Connection=yes;
Where Trusted_Connection is the same as Integrated Security apparently.
If that doesn't work, you should verify that the user is added in the permissions tab (picture) for the database, but I guess you already did that.

Resources