SQL Server does not existor access denied

  • Hi,

    I have been searching for solutions to my problem and there are many possible reasons to have this problem, and hence multiple solutions too.

    So, here is what I have done.

    I installed a new MS SQL Server 2008 R2 Express. 64-bit . To be precise its the last option on <http://www.microsoft.com/express/Database/InstallOptions.aspx&gt;

    While installing I gave 'Named Instance' as 'SQLEXPRESS'.

    Checked if my SQL Server and Browser, both are running.

    Created Exception for sqlbrowser.exe in Firewall

    Added Port 1433 as exception in firewall in both Inbound and Outbound. (I m working on Windows 7)

    Did 'Allow Remote Connection' in the Server Properties.

    Enabled 'TCP/IP' in Protocols for SQLExpress in SQL Server Configuration manager. Set the Port for Protocol IPAII to 1433.

    Tried to run the code from <http://www.tidytutorials.com/2009/08/connecting-to-sql-server-using-c-odbc.html&gt; which is a C++ sample code to connect to a database..

    I am not sure though, if I m using the right connection string. I m using the same one given in the above code, with SERVER=MYCOMPUTER-NAME\SQLEXPRESS, 1433; DATABASE=ABC; UID=SA;PWD=PASS;

    I tried a few from <http://www.connectionstrings.com/sql-server-2008&gt; but did not work out. I havnt tried all, (which is a foolish thing to do, considering there are so many of them) ... But any suggestions to which Connection String is proper, are welcome. Although I think, the problem is not with the Connection String.

    When I run the above program, it gives "Message: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not existor access denied.SQLSTATE: 08001"

    I also tried to connect to the server through Putty. I put in 'MYCOMPUTER-NAME\SQLEXPRESS' as Hostname and '1433' as port and tried to make connection via Telnet, but it says 'Host Doesn't exist'.

    I m running the server on the same computer as my code. as in, my server is local.

    Can anyone please tell me, where I m going wrong or what I must do.

    Thank you very much in advance

  • just a quick question what is your server authentication?

    mixed or just windows?

    the last time i had this issue it was that it was set to windows only and the devs were trying to connect via a sql login. i know... basics!

  • Yes. I had that in mind to mention in the question and I forgot. Its Mixed Authentication.

  • Turns out the Solution is to use "MYCOMPUTER-NAME\\SQLEXPRESS" instead of "MYCOMPUTER-NAME\SQLEXPRESS" in the Server name, field of the sample code which I am using.

  • Hi,

    Are u getting the same error when connecting using the SQL Authentication?

    Becasue from SS2008 onwards, Biultin Administrators donot have SA level access to SQL Server as it used to be in prevoius versions(2000 & 2005).

    Regards

    Ankur

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply