x

connecting to sql azure from odbc dsn

I'm trying to connect to my Azure database by creating an odbc dsn with the ODBC data source administrator. Every combination of username I try fails. I'm using the latest ODBC Client (SQL Server Native Client 10.0 2007.100.2531.00). I've been able to connect through Management Studio with no problem, so I'm guessing it's not a firewall issue. My password doesn't have any special characters.

First try:
Server:mj4bqw8sft.database.windows.net
Used SQL Server authentication and enter Login ID and Password
Checked "Connect to SQL Server to obtain default...."
Got immediate error:
Connection failed
SQLState: '42000'
SQL Server Error: 40531
Server name cannot be determined. It must appear as the first segment of the server's dns name (servername.database.windows.net). Some libraries do not send the server name, in which case the server name must be included as part of the user name (username@servername).

Second try:
Server:username@mj4bqw8sft.database.windows.net
Used SQL Server authentication and enter Login ID and Password
Checked "Connect to SQL Server to obtain default...."
After a long wait got error:
Connection failed
SQLState: '08001'
SQL Server error:1214
Named Pipes Provider: Could not open a connection to SQL Server
also got Login Timeout Expired

Third try (and most interesting):
Server:tcp:username@mj4bqw8sft.database.windows.net
Used SQL Server authentication and enter Login ID and Password
Checked "Connect to SQL Server to obtain default...."
After a short wait got error:
Connection failed
SQLState: '08001'
SQL Server error: 10061
TCP Provider: No connection could be made because the target machine actively refused it.
also got Login timeout expired

Final try:
Server:tcp:mj4bqw8sft.database.windows.net
Used SQL Server authentication and enter Login ID and Password
Checked "Connect to SQL Server to obtain default...."
result is the same as the first try

more ▼

asked Jan 07, 2010 at 09:20 PM in Default

Jim Orten gravatar image

Jim Orten
646 8 8 10

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

I'm answering my own question. I figured it out:
Server: tcp:server.database.windows.net
SQL Server Login ID: username@server
Password: password
check "Connect to SQL Server to obtain default..."

You can then select your default database.

When you test the connection, it will connect but will give a warning message - don't fear! Try your connection out from another tool - mine worked just fine.

more ▼

answered Jan 07, 2010 at 09:23 PM

Jim Orten gravatar image

Jim Orten
646 8 8 10

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x20

asked: Jan 07, 2010 at 09:20 PM

Seen: 3367 times

Last Updated: Jan 07, 2010 at 09:20 PM