SQL Native Client Issue

I downloaded and installed Visual Basic 2005 Express Edition, followed by Sql Server 2005 Express Edition.

When I ran the command

SQLCMD -S SERVER/SQLEXPRESS

I got the following error:
****
HResult 0x35, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [53].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
****

How to resolve this error

Thanks in advance.


Answer this question

SQL Native Client Issue

  • seham

    There are three things that can impact remote connectivity:

    1) Is the SQL Server instance configured to accept remote connections.
    2) If the instance is a named instance (named something other than MSSQLSERVER), is the SQL Server Browser service started.
    3) If the Windows firewall is enabled (or any other firewall for that matter) have sqlservr.exe and sqlbrowser.exe been added to the exception list.

    For details see http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

    Dan 



  • az1538

    It shouldn't matter where the binaries are. In fact, you should not need to enter the full path to sqlcmd either.

    If your instance of SQLExpress is installed on the machine where you're trying to connect, just enter the following from a console window:

    sqlcmd -S .\SQLEXPRESS

    If you cannot connect to the local machine, verify that the service is running.

    jeff.


  • antoan

    Thank you very much Jeff,

    It is now actually working, I wondering why it did not worked
    with the full path

    I am currently doing working on my final capstone course
    I need to be a program from start to finish
    from paper to the actual applacation

    I have choosen to use visual web developer expresss 2005
    and SQL express 2005, I am shure I am going to run into some
    some walls or deadends,

    luckly people like you are around..

    do you have any better recomendation

  • Robin Moss

    I am getting this same error, I'm trying to connect VB 2005 Exp on XP Home to SQL Server 2005 Exp on XP. TCP/IP protocols are enabled on the server and VB is attempting to connect via TCP/IP and the connection with time out with the follow message:
    An error has occurred while establishing a connection to the server. When connection to SQL Server 2005, this failure may be caused by the fact the under the default settings SQL Server does not allow remote connections.
    (provider: SQL Network Interfaces, error 26: - Error locating Server/Instance specified)

    I get this when testing the connection in VB when attempting to add a connection to the database explorer.

    Thanks in advance
    greg


  • nmfns

    Hello,


    I have a similar issue as I cannot connect to my installation of SQL Server 2005 Express using bcp:

    bcp MyDatabase.dbo.MyTable in datafile.csv -T

    I get this response:

    SQLState = 08001, NativeError = 2
    Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open a con
    nection to SQL Server [2].
    SQLState = HYT00, NativeError = 0
    Error = [Microsoft][SQL Native Client]Login timeout expired
    SQLState = 08001, NativeError = 2
    Error = [Microsoft][SQL Native Client]An error has occurred while establishing a
     connection to the server. When connecting to SQL Server 2005, this failure may
    be caused by the fact that under the default settings SQL Server does not allow
    remote connections.

    However, I can properly connect using sqlcmd! Both sqlcmd and bcp were run from the same computer where SQL Server 2005 Express is running (OS: Windows XP, SP2).

    What am I doing wrong here

    Thanks in advance for any help!



  • AnOracle

    Good luck on your studies!

    If you are new to ASP.NET be sure to check the quick start samples and the many walk throughs in the product documentation. And of course, when you have questions, feel free to post away. :)

    jeff.

  • PsychUK

    John,

    Are you trying to connect from the same machine that SQL Server is running or is this another machine What is the OS that SQL is running on Do you have the Windows firewall enabled

    Cheers,
    Dan

  • Aliaksei Baturytski - MSFT

    Thanks Jeff.

       I found that SQL Server Browser service was disabled. I enabled it and started it. Then I was able to connect using 

       sqlcmd -S .\SQLEXPRESS

       Thanks for the help.

    -- JB

  • BryanNate

    I would like to also say that i do enter a minimum of 7 char

    and also I enter one numeric char. This occurs under the Timetracker kit,
    what happens is that when the program is executed it will go into
    login page if you dont have a user and password name then
    you'll get the option of creating a new user

    Every time I enter a password the same error comes up. 

  • Ginny DiMario

    John,

    I'm glad you're up an running. One note of clarification. The SQL Browser service is only needed for remote connections. It is not needed when you're connecting from the same machine running SQL. Sorry I didn't catch the "\" versus "/". That would have saved you some time.

    Dan

  • iaragorn

    I am currently having problems with creating a new user

    this happens under visual web developer 2005
    here is what it looks like:


    User Detail
    Sign Up for Your New Account
    Password length minimum: 7. Non-alphanumeric characters required: 1.
     

  • Sunny2006

    I also have a similar problem i can not connect to "E:\Program Files\Microsoft SQL Server\90\Tools\binn\SQLCMD" -S "machine-name\SqlExpress" is it a problem that my system files are on my E: drive,

    I would greatly appreciate the help

  • felipegc

    Thanks Dan.

       I am trying to connect from the same machine that SQL Server is running, and it is running on Windows XP sp2. 
       Yes, Windows firewall is enabled.

       I found that SQL Server Browser service was disabled. I enabled it and started it. Then I was able to connect using 

       sqlcmd -S .\SQLEXPRESS      (following Jeff's advice)

       Thanks for the help.

    -- JB


  • PersianAmir

    Hi John,

    The command should be in the form:

    sqlcmd -S SERVER\INSTANCE

    NOT

    sqlcmd -S SERVER/INSTANCE

    Also, if the server is local, you can replace server with a period (.):

    sqlcmd -S .\INSTANCE

    If you are attempting to connect to a remove machine running SQLExpress, you need to enable the TCP\IP Protocol as it is disabled by default, and you'll need the SQL Browswer service running for a Named Instance.

    jeff.



  • SQL Native Client Issue