Set up SQL Server to be accessible by all computers on a network via program manipulation - sql

I am testing a SQL Server for my company as an on-site database for manufacturing data and records. I have the SQL Server on my laptop and have set up permissions and downloaded SQL Server Management Studio on other computers in the company and managed to connect via SQL Server authentication.
However, I can't get Windows Authentication to work. I also have a Visual Basic program that I can run on my laptop that will communicate with the SQL Server that is locally on my machine but that program will not work on other computers in the company because they can not connect to the SQL Server.
How do I set up SQL Server to allow for Windows authentication on any company computers running that program? I opened a port on my Windows firewall on the computer that has SQL Server installed, and it seems to work with SQL Server authentication.
The connection string I am using in my Visual Basic program is as follows:
Dim connstring As String = "Data Source = Server; integrated security = true"
I assume I need to change something in my logins folder in my SQL Server?
My desired result would be for any computer running this application to be allowed to communicate with SQL Server and be able to read and write data.

any computer running this application to be allowed to communicate with SQL Server
The normal configuration to enable this is:
1) The SQL Server must be running on a server joined to the domain.
2) The SQL Server is configured to use TCP/IP and listen on port 1433.
3) The other computers are also joined to the domain.
4) The users logged in on the other computers are added as Windows logins. in SQL Server, and mapped to users in the desired databases (can use groups instead of individual users).
See eg: How to add Active Directory user group as login in SQL Server

Related

Connect to SQL Server in VM using local machine

I would like to connect SQl server DB in VM using my local sql server management studio.
What should I need for server name ?
Can I use my server Windows authentication for VM in my local ?
Create an empty text file on your VM and give it extension .udl
Doubleclick on it now you can set the properties easy from combobox
Adjust the properties and click on "test connection" until it works
Now open the file in notepad and there you see a complete connection string.
Note that for SQL Server authentication you need to configure the protocol in SQL Server Configuration Manager
When you are in Management studio on your local machine, you will need the hostname or IP address of the VM.
For Windows Authentication, you will need an account on the local domain that both your workstation and the database VM are connected to.
For SQL server authentication, you will need an account in the SQL Server instance.
In both cases, security will need to be configured and associated with your account.
Are you on a domain, or is this just a private server?
Use name of the VM where SQL server is running.
And yes, you can use Windows authentication. Depending on your domain settings.
This will help you How to: Create a SQL Server Login It is not much difference from SQL login.
And if you are in Administrators group on machine running SQL Server, then your login already should be included.
And if your machine with Management Studio and server with SQL Server are in different domains, then you will need to run Management Studio under different account
runas /netonly /user:domain\username "c:\path\ssms.exe"
See Connect to SQL Servers in another domain using Windows Authentication

Connecting to a SQL Server Express 2012 from another computer using MS Access

I have set up an instance of SQL Server Express 2012 on a computer. On this computer I use MS Access as the client to access the data stored on the SQL Server Express. When I open MS Access and click on an object it then prompts me for the SQL Server username and password (I set up a SQL Server Native 11.0 Driver). This works fine. The goal is to put the file on others computers so they can access the data on our SQL Server. I also have enabled the TCP/IP protocols to allow remote connections as well as the Firewall settings that are necessary. However, when I place the file on another computer, it returns SQL Server Error 53.The strange thing is that I have another computer that I tested this on and it works perfectly fine.
My assumption is that I am missing software on the client computer. What software must be present on the client computers so it will be able to access my SQL Server Express on the "server computer"?
Please let me know if you have any questions, at this point I am stumped.
If you're using ODBC, then on the 2nd computer you need to
Start->Control Panel->Data Sources (ODBC)
Select System DSN tab
Click Add...
Select SQL Server Native Client
Give it the same name as the name on the working computer
Select the server to connect to etc.
and you should be OK

How to find why application cannot connect to SQL Server 2008

Windows application is set to connect to the SQL Server using SQL Server authentication.
When I RDP to the box where the application resides and start the application, it successfully connects to the SQL Server.
When a customer runs the application on his desktop (he is on the network with the application box) and starts the application, connection fails (error. Server does not exist or access denied).
The customer can ping the SQL Server IP in his command prompt.
Yet, when I look at the error log on the SQL server I don't see the logs of his failure to connect.
What could be blocking his access to the SQL Server?
You may have to enable the TCP/IP protocol in SQL Server Configuration Manager - it's disabled by default.

SQL Server fails to connect to database on client

I have installed SQL Server 2008 R2 Express on a Windows Server 2008 R2 machine, and now when I want to open that database using SQL Server Management Studio on the client machine it fails to open.
But the database opens normally on the server.
The owner of the database is sa and on client I am logged in with windows authentication.
How to resolve this error??
the server priciple smtech/prabhu is not able to access the database
the user is of client under the server domain
I suggest making sure that the account you are trying to connect with actually has access.
Log onto the server, open up management studio, look in object explorer. There should be a Security folder icon in the treeview, Expand that and the Logins folder.
If the user you are trying to connect with isnt present you may need to add it.
Other than this instead of connecting with windows authentication maybe try connect with SQL Server Authentication as the SA user?
Is both Client and DB sever are on SAME domain ?? If not, then I think Windows Authentication will not work for you.
(As already suggested in above answer) create a SQL Login try with to connect DB from Client using that Login.
If both machine are on same domain and still you are not able to connect server, then few things you can check,
Can your client actually "see" this server over network ??
Most common reason is firewall. By default SQL Server communicates from port 1433 and 1434. Try to see if this MSDN link helps
Make sure that your SQL Server instance is configured to communicate using TCP/IP. This can be configured from SQL Server Configuration Manager.

How to connect database over local area network SQL Server 2008

I want to connect my db on SQL Server 2008 over local area network I want to put it on one computer on the LAN so any computer on the network can access it what should I do please give me correct steps
In a Client-Server scenario, you will have the SQL Server installed on your server machine.
Clients will be the computers accessing that SQL Server using a client software (can be SQL Server Management Studio, web/forms application, Excel worksheet, etc).
Each of the client will provide you a way of making a connection to the SQL Server Instance running on the server. From server you will need IP Address or Servername along with SQL Server Instance name. They both combined form host name.
Data Source = ServerName\InstanceName
Note: Instance name not required for default instance.
User name: You need to add user from domain or a sql server authenticated user under security tab (SSMS) on the SQL Server.
Password: Corresponding password.
Note: Once you add a user to SQL Server Instance, do not forget to attach the user to databases you want the user to access and provide appropriate role(s).
Install SQL Server 2008 on one machine on your LAN (let's call it SQLServer)
Connect that machine to the LAN (network cable)
You're done.
Now, all other computers can connect to that SQL Server machine by its name in the connection string - in .NET, that would look like:
server=SQLServer;database=YourDatabase;User ID=YourUser;Pwd=top$Secret