Connecting to MS SQL database using ODBC drivers from local machine - sql-server

Currently we are using the odbc driver to connect to our MS SQL Server. We however want to be able to pull a directory down to our local machine, make changes, and push back to the server. We are able to connect to the MS SQL Server from our server but we cannot make the connection from our local machines. Does anyone know how to do this? We want to still use the odbc driver as that is what we are using on our server for connections.
thanks!

You may not be able to connect to the Server via ODBC because of network issues. When you are creating your ODBC connection, have you tried to use the IP address of the SQL Server as opposed to the server name? You may also need to use the DOMAIN\Server syntax.
There are quite a number of potential reasons you cannot create the ODBC connection. This link addresses some of those issues:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b479cb4a-99a8-437a-8796-7d9f77910ec8/cant-create-an-odbc-connection?forum=sqlexpress
Hope this helps. Let me know if you still have issues.

Related

How to connect to SQL Server using ODBC driver?

I am trying to open a connection to a Microsoft SQL Server, I opened the ODBC and went to the System DSN->add->selected SQL Server. However there are no SQL Servers to connect to.
This is probably a simple fix, but this is the first time I'm dealing with microsoft SQL Server
Just type in the name of the SQL Server instance you want to connect to. If it's a default instance type the servername. If it's a named instance type in servername\instancename. You'll then be able to configure the DSN as needed.
The control for list of available servers is notoriously unreliable for what is actually available/reachable.

running program in computers without sql server

Is it possible to run a program in which a SQL Server database has been used in other computers where "SQL Server" has not been install?
Certainly, you'd change the connection string to connect to a remote server like this:
Server=RemoteServerName;Database=DatabaseName;...
and in fact, that's the most common production configuration. A shared database amongst multiple users.
The answer is YES. The only thing you need to do is to point where the Microsoft SQL Server is placed. Of course, you need to configure the server to accept remote connections and that the client you're tring to connect has internet access.
Configure SQL Server to accept remote connections
Guessing that you use c#...
Connection strings for c#

Create ODBC Connection from Access to SQL Server

I need help connecting from a blank access 2010 database to my remote SQL Server 2005 database. This is because I'm going to write all my client apps in Access, and store everything on the server with SQL Server. I'm using the wizard, and trying to make a new DSN. What do I put for:
Which SQL Server do you want to connect to?
Server:
The server is windows server 2008, and it is remote. I've been connecting to it with a .RDP file, but I'm not sure how to set up the link.
Please ask me to clarify anything that doesn't make sense.
Thanks.
Enter the IP address or the Windows Host Name for the server that has SQL Server on it.
You'll need to make sure that your server has port 1433 open in it's internal software firewall. If you're going through any kind of router that router will also need to have port forwarding and possibly the firewall opened up for port 1433.
Also, you'll need to make sure that your SQL Server instance is setup to listen on TCP/IP with port 1433 (unless you choose a different port).
You might be best off trying to connect to it from SQL Server Management Studio first. Once you have that working you should have an easier time setting up your DSN.
For troubleshooting, see this:
http://blogs.msdn.com/b/sql_protocols/archive/2005/10/22/sql-server-2005-connectivity-issue-troubleshoot-part-i.aspx
http://blogs.msdn.com/b/sql_protocols/archive/2006/09/30/sql-server-2005-remote-connectivity-issue-troubleshooting.aspx

SQL Server 2008 R2 First-Time Connection Issues

We've been experiencing a strange issue with SQL 2008 R2 (10.50.1600) installed as a named instance. In order for any external clients to connect, we have a certain procedure we have to follow, but should not have to. Now I did in fact open the TCP/IP and Named Pipes protocols on the SQL server and restarted it, this isn't the problem. We're on an Active Directory Domain (running from Server 2003). The problem exists no matter what OS the server or client is (XP, 2003, 2008, Vista, 7, 64bit, 32bit, etc.). The problem also persists from anything which can connect, for example, SQL Management Studio, ADO (from our applications), etc.
The problem is that before any client can connect to this server, each client machine must first connect to this server through ODBC (and we don't use ODBC). Any attempt to connect to a 10.5 SQL server before doing this results in "Server does not exist or access denied". But once we can connect in the ODBC (through Named Pipes), then everything else starts to work. The same issue occurs both when using the Computer Name and IP Address. In fact, if we want to connect with computer name \ instance name, then we have to do so first in the ODBC, and then if we want to connect via the IP address \ instance name, then we have to do the same also for that.
We've been having to do this on every single client computer. Again, once the ODBC is able to connect to this SQL server through Named Pipes, then all future attempts from that client work.
What could be causing this to occur? How to avoid it? I should not have to do this "ODBC Trick" as we've been calling it. I've never had this issue on any other version of SQL.
The issue might be related to the SQL Browser service. Each sql instance will have a different port number - try connecting from the client as IP Address,Port (e.g. 123.123.123.1,1433) - this will exclude DNS and Browser from the equation
Edit: now knowing that it is browser related, try see why clients can't access SQL Browser (usually Port 1434). Service not started? Possibly firewall blocking?
Microsoft have tied down everything security wise now by default, so any new configuration now generally requires quite a bit of detailed security planning, policy configuration, permissions etc. Welcome to the age of non-trust ;)
You could easily test your connection by creating a simple file. Follow the steps here at "How to test an SQL Server connection": http://teusje.wordpress.com/2012/02/21/how-to-test-an-sql-server-connection/

Invalid Key for attachdbfilename

I am using SQL Server DB. The connection string is
Data Source=office1\SQLEXPRESS;AttachDbFilename=|DataDirectory|\dbSQLTest.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True
On local computer it is fine. On the network computer, it gives
"Invalid Key for attachdbfilename"
I do not want to make server client application. My purpose to use Sql server DB is to run my application on 3-4 computer simultaneously. I just make shortcut from my main computer to the network computers.
The reason why I donot attach with server instance is that it is difficult for the users to attach DBs with server and then manage SSMS.
Please advise
Thanks
Furqan
AttachDbFilename is used with local database. If you have remote database then the connection string will be different. Have a look at article - How to configure SQL Server 2005 to allow remote connections.
I'm not sure I am understanding you correctly, but you can't simultaneously attach the same MDF on a network drive by several concurrent users (like you can do with MS Access).
Rather just install SQL Express on a central computer and open it up for remote TCIP/IP access, and change the connection string to an IP / instance one.

Resources