[Microsoft][ODBC Driver Manager] Can't establish connection to SQL server - sql

Very new to this so I do apologize.
My client sent me a .accdb file, .dsn, and .txt containing the username and password.
My assumption is that I need to start the ODBC Administer (64 bit), then add DSN file, and then input the username, password values when setting the connection up. However when I do that, my error says that the database does not exist OR my credentials are wrong.
Am I approaching the connection path completely wrong? Help steer me towards the right direction.

The database does not exist error implies that the the server is not reachable based on the settings entered. This can happen if the database is behind a firewall and perhaps you need a VPN connect or the server name / database name are not correct. In the DSN, you should have the server name, IP address or domain name. You can try pinging the server name from a command prompt to see if you have connectivity to it. Is the database hosted on the clients network or hosted on the Internet i.e. godaddy.com or another web hosting provider?

Related

Can't connect to a SQL server remotely

i'm a new to stackoverflow but maybe i may also ask a question. I also hope i can help others to find solutions regarding their issues.
So, here we go. I moved a database from an old SQL server to a new one. While trying to configure the application to use the new location of that database shows up an error message like this:
Cannot connect to \MSSQLSERVER.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid) (Microsoft SQL Server, Error: 87)
The parameter is incorrect
So i started an analysis to solve this issue. And i checked those things:
DNS resolution -> check
ping to the new SQL Server -> check
Firewall disabled -> check
Remote connections on SQL Server enabled -> check
Still receiving this error message. I configured the SSMS on the application server and ran that as SQL server service user without any success.
SQL Server browser is running
TCP/IP is enabled using the default port 1433
I am not sure regarding the SQL server instance name. IMHO it is shown in the service name and the default instance name is MSSQLSERVER. The error message mentions that the connection string is not valid.
So, at this point i don't have any further ideas.
Greetings,
Chris
[EDIT] I don't use any specific connection string because i connect using SSMS.
enter image description here
[EDIT2]
I was able to connect locally using the hostname (not localhost).
All tests below do not use an instance name
Test Result
-----------------------------------------------------
Locally, hostname, AD Auth Success
Remote, hostname, AD Auth The target principal name is incorrect. Cannot generate SSPI context
Remote, FQDN, SQL Auth Connection string is not valid
Step 1: Login Authentication Windows or SQL Server
Check your login Authentication whether its Windows or SQL Server.
Step 2: Use (.) (dot) instead of complete server name
If you are using local MS sql database then you can use (.) (dot) instead of complete server name.
Step 3: Enter Correct Host Name
Enter your correct host name: (hostname\SQLEXPRESS) my_hostname\SQLEXPRESS (in case of SQL Server Express) or (my_hostname\mssqlserver).
Step 4: Try localhost slash () then host name
You can also try localhost slash () then host name, here is sample as (localhost\SQLEXPRESS) or (localhost\mssqlserver).

Cannot access Azure SQL database

I am having trouble accessing my Azure SQL database. I Have whitelisted my ip address(using 'what is my ip' in google to find it) The connection string in the azure portal is -
Driver={SQL Server Native Client
10.0};Server=tcp:nrmuolxpqg.database.windows.net,1433;Database=databasename;Uid=username#nrmuolxpqg;Pwd={your_password_here};Encrypt=yes;Connection
Timeout=30;
What do I put into the Migration Tool, or into visual studio as the connection properties? In particular what to do with the 'tcp' at the starte of the server string?
The fields I need to fill in are:
-Server name (do I need to put tcp or the port number in here? )
-Login
-password - (this is my windows account password right? )
-Database
The only thing you need to change is the username and password. This is something you specified when you created the server. It's not the same as your Windows username and password.
If you forgot the password, you can reset following these instructions, Password reset for Azure database.
EDIT 06/20/2018 - Finding the username
If you forgot your username, you can find it by clicking the Show database connection strings link in the Essentials window.
The ADO.NET connection string will not show the username but any of the other examples will.
Here are a few additional things you can try to resolve connection issues.
Try pinging the server. The server doesn't respond to the request but the name should be resolved to an IP address.
Verify that your client IP address has been added as a firewall rule.
Make sure you are using the correct connection string (in your question you are using the ODBC connection string, you might want to try the ADO.NET one). Also double-check that you use the correct username and password.
To connect from Visual Studio, add a connection from the Server Explorer window using the server name and login info as shown below. Obviously you have to change the server name and login info to match you specifics. I'm connecting to a database called StackDemo in the below screenshot.
If you still can't connect, there might be an issue where your company's or personal firewall is blocking the connection.

Unable to connect to SQL server using vb.net

I am using Connection string in my web.config. I have given user id, password, data source etc in the connection string. When i tried to connect to the SQL server using "Connection.Open()" I am getting an exception stating The user is not authorized. The user name that is mentioned is my windows user name(yes my windows user name and not the one mentioned in connection string). I am not sure why and how this is happening. I tried several times and the same thing is happening.
If you believe that VB.NET is part of the problem, try using the same connection parameters from the same client, but with different client software. For example try connecting from Access or SQL Server Management Studio or Excel. This will help you narrow down whether your problem is with the security configuration versus the code or client software. Often times if you try to connect from a remote workstation you can end up with a failure against a server that has not been configured to allow remote connections.

Named pipes provider could not open connection to SQL Server 1231

I am trying to set up a linked server and running into an issue.
On the target server I have configured a user, let's say Q. I have set the source server to connect with Q's login credentials no matter what user is logged in at Source Server.
However when I try to connect, I get the error
"Named pipes provider : could not open a connection to SQL Server
[1231]."
I have tried enabling and disabling named pipes in the server configuration manager, to no avail.
Also I have seen some things saying it is a security problem. The thing is, I am able to connect from Target to Source using Q's credentials in SQL management studio just fine.
Is there something stupid I'm missing here?
is the firewall at the linked server on?
check if the firewall is blocking the named pipes port, which usually is 445
try telnet to the linked server via port 445
Open Server Objects\Linked Servers, then Properties on your linked server. What did you enter here - maybe you are mapping some existing credentials to target credentials?
You should only check the option "Be made using this security context" and then enter Q and it's login. Also, check the "Server Type" to match the destination (Sql server)
On a side note, if the error were due to not supporting of named pipes, I thing you would get a different error, like "error 28 Server doesn't support requested protocol"..

Using MS Access 2003 to connect to SQL Server 2005

My dad built an MS Access Database to do property management. Now he wants to share it with other users over the internet. So I got a hosted SQL Server account at Network Solutions. Now I'm trying to connect the Access 2003 client to a test SQL database using these guidelines from MS:
http://office.microsoft.com/en-us/access/HP052745861033.aspx
However, the error message I get is "Connection Failed because of an error initializing the provider. Server does not exist or access is denied".
I've run the MSComponentChecker to make sure I have MDAC 2.7 or above. Mine is 2.8 SP1 on XP.
It sounds like either:
(1) your workstation is unable to connect to the SQL server instance because
(a) the hostname isn't resolving correctly
or
(b) a firewall in your network or on your workstation is preventing the outbound connection on the needed port
or
(2) you can connect and have the correct username and password but don't have sufficient privileges to get to the database you're attempting to use. Access gives a different error than what you received if you have a bad username or password ("Login failed for user 'xxxx').
You can check the networking by running "telnet example.com 1433" (whatever hostname and port you were given to use; if you weren't given a port, use 1433) and making sure you can connect (the command window will go to a blank screen). If that works, you can then confirm with your provider that the account you're using has been granted the needed permissions. If you can't telnet to the address you need, check you have the right hostname and the existence of any firewalls.
After a little more research, I figured it out.
In MS Access 2003, you have to enter the server name in this format:
serverName\instanceName,portNumber
This is a BackSlash, not a ForwardSlash. Thank you MS.
Not sure why I had to specify the port number when it's the default.
Special thanks to this post:
http://dbaspot.com/forums/sqlserver-server/251219-error-connecting-remote-server.html
It should be noted that you can't do much design work in Access 2003 once you are connected. So I needed to upgrade to 2007 to change the SQL schema. Hopefully, 2003 users will still be able to connect and use the app.