Error connecting to Sql Azure: TCP Provider: No such host is known - oledb

I am trying to connect to SQL Azure using OLEdb. When i do, i get the error:
Source: Microsoft SQL Server Native Client 10.0
Description: TCP Provider: No such host is known.
SQLState: 08001
NativeError: 11001
I can connect using:
SQL Server Management Studio, and
Red-Gate SQL Compare
so it's not like there's a firewall, server, or credential problem.
But i cannot connect myself from a native application using the OLEdb provider.
First i try a completely wrong username, and no password
Provider=SQLNCLI10;Data Source=tcp:hyperion.database.windows.net,1433;Initial Catalog=Scratch;User ID=adlfk24lksdfj#hyperion;
Gives the (expeccted) error:
Source: Microsoft SQL Server Native Client 10.0
Description: Login failed for user 'adlfk24lksdfj'.
SQLState: 28000
NativeError: 18456
Then i give it a valid username, but no password:
Provider=SQLNCLI10;Data Source=tcp:hyperion.database.windows.net,1433;Initial Catalog=Scratch;User ID=iboyd#hyperion;
That returns the (expected) error:
Source: Microsoft SQL Server Native Client 10.0
Description: Login failed for user 'iboyd'.
SQLState: 28000
NativeError: 18456
Then i give an invalid password:
Provider=SQLNCLI10;Data Source=tcp:hyperion.database.windows.net,1433;Initial Catalog=Scratch;User ID=iboyd#hyperion;Password=trubadour;
That returns the expected error:
Source: Microsoft SQL Server Native Client 10.0
Description: Login failed for user 'iboyd'.
SQLState: 28000
NativeError: 18456
And then the valid connection string
Then i give it the correct1 username and password:
Provider=SQLNCLI10;Data Source=tcp:hyperion.database.windows.net,1433;Initial Catalog=Scratch;User ID=iboyd#hyperion;Password=correcthorsebatterystaple;
And i get the unexpected, nonsensical error, after a 15 second pause:
Source: Microsoft SQL Server Native Client 10.0
Description: TCP Provider: No such host is known.
SQLState: 08001
NativeError: 11001
1 Of course those are not my actual credentials. But is there any free test SQL Azure database out there i can test connecting to?
Bonus Reading
ConnectionStrings.com: Sql Azure
Why doesn't Microsoft support OLE DB connections to SQL Azure?
Microsoft Azure Technical Evangalist:
You can use it, however it has not been thoroughly tested for all cases. Essentially, it should work for most things, but there might be a few edge cases where it won't work. Until we document those cases, it remains unsupported. That being said, if you were to use and run into errors, we would love to know about it and prioritize that to be fixed.
Azure connection string exception "network-related orinstance-specific error occurred"

The answer is as horrifying as it is terrible.
I was using:
hyperion.database.windows.com

Related

Azure Hybrid Connection SSPI handshake failed

I have an instance of Azure Hybrid Connections running on a server where SQL Server is installed.
I hosted an WebApp on azure, set up the hybrid connection and I'm consistently getting the same SSPI Handshake error
SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The operating system error code indicates the cause of failure. The logon attempt failed [CLIENT: 1x.xx.xx.xxx]
As described here I added the clients ip in the local security policy.
I also tried adding the DisableLoopbackCheck=1 in HKLM\System\CurrentControlSet\Control\LSA, but it didn't help either.
Do I have to fix it on a database level perhaps?
As per https://github.com/Huachao/azure-content/blob/master/articles/app-service-web/web-sites-hybrid-connection-connect-on-premises-sql-server.md
[AZURE.NOTE] To ensure that your application uses the database that you created in SQL Server Express, and not the one in Visual Studio's default LocalDB, it is important that you complete this step before running your project.
Edit the connectionStrings section to point to the SQL Server database on your local machine, following the syntax in the following example:
I added user credentials to my connection string in appsettings.json and it now works.

Visual Studio 2017 Web App with SQL Authentication Error 52

I am trying to publish a VS2017 web app to a godaddy domain with authentication on a remote SQL server. The app works fine when run from the Visual Studio environment. I can log in, register, etc and see the data on my SQL Server. When deployed I get ::
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: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]
Fixed - I discovered that the web.config file on the domain server did not get updated with the proper connection string.

JDBC access to Azure database

Using the Azure SDK for iOS, I have an app writing to the database. I'm now trying to configure a query using ODBC and Excel. As I'm on a Mac, only JDBC is an option.
JDBC connection only gives "Network error IOException: Connection refused"
I have setup up the Azure firewall settings for the machine IP.
Anyone with any Azure/iOS dev experience?
Thanks
Martin
Please use Microsoft JDBC Driver and make sure your connection string conforms SQL Azure Connection string. Required properties are:
Encrypt=True
Trusted_Connection=false
Database=[database name]
You shall have no issues with this setup.

SQL Server 2012 Express connection error

I installed SQL Server 2012 but not able to connection to express instance getting below error:
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: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
SQL Server is attempting to register a Service Principal Name (SPN) for the SQL Server service. Kerberos authentication will not be possible until a SPN is registered for the SQL Server service. This is an informational message. No user action is required.
2012-07-20 11:37:08.72 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/VIPUL-MEHTA.XXXX.com ] for the SQL Server service. Windows return code: 0x2098, state: 15. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
Here is my SQL Server Configuration settings
In management studio I am providing below information to connect:
Server: .\MSSQLSERVER
Authentication: Windows Authentication
In SQL Server 2012 how can I change the settings of Surface Area Configuration.
I forgot the password for SA, so I cannot connect using SQL Server authentication.
Here is TCP IP Settings:
Just open incoming port 1433 in the Windows firewall for TCP access:
http://blogs.technet.com/b/danstolts/archive/2011/06/08/how-to-open-firewall-port-1433-for-sql-server-database-engine-for-use-with-scom-or-anything-else.aspx
I just had this problem solved by following this guy's answer
Can't connect to localhost on SQL Server Express 2012 / 2016
re-installing SQL was the only solution in my case. Learning is always attach 2-3 windows account with SQL Server.
In my case, SqlServer Service was somehow stopped,i think it's because after installing MySql.I changed back it's state to 'Running', and it works now:
Go To Sql Server Configuration Manager
Click on 'Sql Server Services' in the left pane
Right click on the 'SQL Server' in the right pane and click on 'Start'
http://i.stack.imgur.com/ZuTV3.png

Cannot add App_Data SQL Server database

Using Visual Studio 2010 10.0.20319.1 RTMRel and SQL Server Express 10.50.1600.1 I'm trying to add a new SQL Server Database .mdf, however, I receive the following error:
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)
I have enabled TCP/IP and Named Pipelines, added Firewall Exceptions for Sql Server, I am successfully connecting from VS in the Server Explorer window.
I would appreciate if someone can pint me to a solution to my problem.
Thank you.
I think that SQL Server must be running locally to be able to create those databases.
I was getting the same error
Started my local .\SQLEXPRESS instance
no more error, and a cute .mdf file was created
According to your error
(provider: SQL Network Interfaces,
error: 25 – Connection string is not
valid)
check here what your connection string should look like
http://www.connectionstrings.com/sql-server-2008

Resources